[lvm-devel] [PATCH 2/4] Add lvseg 'get' functions.

Petr Rockai prockai at redhat.com
Thu Oct 21 16:36:22 UTC 2010


Zdenek Kabelac <zkabelac at redhat.com> writes:
> I really think this API is wrong somewhere - there is way too many duplication
> - this isn't going to be very efficient....
> I do like the beauty of const strings....

I disagree. Having a consistent API is currently more important than
efficiency. We don't have any profile data, etc. So what you are asking
for is premature optimisation, IMO. We can ditch the duplication later
as needed. (Hopefully, we will be able to somewhat improve the general
memory allocation patterns used by LVM, independent of this. Presumably,
having better definitions of lifetimes of different things on a lower
layer would also make it feasible to rely on that lifetime in the
API. For now, I think it is a sound approach to just duplicate
everything to be on the safe side. Rule of thumb: get a working version
first, write tests, then worry about performance.)

Yours,
   Petr.




More information about the lvm-devel mailing list