* [LVM2 RFC PATCH] Tidy extent-related variables in allocation code
@ 2007-08-21 22:59 Jun'ichi Nomura
0 siblings, 0 replies; only message in thread
From: Jun'ichi Nomura @ 2007-08-21 22:59 UTC (permalink / raw)
To: lvm-devel
Hi,
This patch is rfc, not very well tested yet.
Current allocation code is very hard to read and I think
part of the reason is the ambiguity of 'extents' variables.
Some are length of LV, others are the number of extents.
It makes the code prone to introduce errors.
For example, in _find_parallel_space(), this code:
if (needed - *allocated > free_pes) {
log_error("Insufficient free space: %" PRIu32
" extents needed,"
" but only %" PRIu32 " available",
needed - *allocated, free_pes);
checks the free physical extents.
But since 'needed' and 'allocated' are the length of LV,
the comparison doesn't work as expected if the LV is mirrored
because 1-extent of n-way mirrored LV requires n-extents.
I would like to know if the idea of renaming makes sense
and if there are better names of variables and conversion functions.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-allocate-rename-extents-variables.patch
Type: text/x-patch
Size: 13552 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070821/3ec4c7c3/attachment.bin>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-21 22:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21 22:59 [LVM2 RFC PATCH] Tidy extent-related variables in allocation code Jun'ichi Nomura
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.