From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [PATCH LVM2] (2/12) rewrite with struct allocation request
Date: Fri, 13 Oct 2006 16:55:51 -0400 [thread overview]
Message-ID: <452FFD57.6040407@ce.jp.nec.com> (raw)
In-Reply-To: <452FFCFB.6090805@ce.jp.nec.com>
This patch introduces 'struct allocaction_request' to generalize
the allocation request currently embedded in struct alloc_handle.
o The struct is in this form:
struct allocation_request {
uint32_t len; /* requested length of single area */
uint32_t area_count; /* number of areas with same length */
uint32_t multiple; /* LV size is extended with (len * multiple) */
uint32_t allocated; /* allocated length of single area */
int flags;
int index; /* index to alloced_areas[] */
};
For example, if you do 'lvcreate -l3 -m1', the first allocation
request would be:
{ len = 3, area_count = 2, multiple = 1, index = 0 }
and for the 2nd allocation (i.e. log) would be:
{ len = 1, area_count = 1, multiple = 1, index = 2 }
_handle_allocation_requests() will call _find_parallel_space() for
each struct allocation_request.
The flags is used to describe preference and also be used later
to find out for what purpose the request was.
o _find_parallel_space() is simplified since we don't need to carry
around the attempt-wide "*allocated" or "max_parallel" and a lot of
division and multiplication.
o lv_add_log_segment() is changed to search alloced_areas for log.
It should be easily extended to cope with multiple log allocation.
o Set up of struct allocation_request is done in _alloc_init().
It seems better to do it out side of allocate_extents()
and allocate_extents() to take the array of struct allocation_request.
$ diffstat -p1 02.alloc_requests.patch
lib/metadata/lv_manip.c | 459 ++++++++++++++++++++++++++++++++-------------
1 file changed, 310 insertions(+), 149 deletions(-)
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02.alloc_requests.patch
Type: text/x-patch
Size: 24365 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20061013/6d5a1bc7/attachment.bin>
next prev parent reply other threads:[~2006-10-13 20:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 20:54 [PATCH LVM2] (0/12) LVM2 allocation rewrites Jun'ichi Nomura
2006-10-13 20:55 ` [PATCH LVM2] (1/12) add flattened index to _for_each_pv() Jun'ichi Nomura
2006-10-13 20:55 ` Jun'ichi Nomura [this message]
2006-10-13 20:57 ` [PATCH LVM2] (3/12) remove ix_offset from _find_parallel_space() Jun'ichi Nomura
2006-10-13 20:58 ` [PATCH LVM2] (4/12) separate constraints checker " Jun'ichi Nomura
2006-10-13 20:59 ` [PATCH LVM2] (5/12) allow preference to small area Jun'ichi Nomura
2006-10-13 21:00 ` [PATCH LVM2] (6/12) move _add_pvs() to the earlier part of the file Jun'ichi Nomura
2006-10-13 21:00 ` [PATCH LVM2] (7/12) update parallel_areas for on-going allocation Jun'ichi Nomura
2006-10-13 21:01 ` [PATCH LVM2] (8/12) 'anywhere' policy implementation Jun'ichi Nomura
2006-10-13 21:13 ` [PATCH LVM2] (9/12) lvconvert to use build_parallel_areas_from_lv() Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (10/12) calculate free pe counts before allocation attempt Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (11/12) extending parallel_area to cover log device Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (12/12) sort the allocation requests Jun'ichi Nomura
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=452FFD57.6040407@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.