From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [LVM2 RFC PATCH] Tidy extent-related variables in allocation code
Date: Tue, 21 Aug 2007 18:59:19 -0400 [thread overview]
Message-ID: <46CB6E47.7040403@ce.jp.nec.com> (raw)
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>
reply other threads:[~2007-08-21 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46CB6E47.7040403@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.