From: malahal@us.ibm.com
To: dm-devel@redhat.com, lvm-devel@redhat.com
Subject: Re: [PATCH 2 of 10] LVM: make log_area a list
Date: Mon, 12 Oct 2009 18:48:20 -0700 [thread overview]
Message-ID: <20091013014820.GA27349@us.ibm.com> (raw)
In-Reply-To: <200910082118.n98LIaik014287@hydrogen.msp.redhat.com>
Jonathan Brassow [jbrassow@redhat.com] wrote:
> Patch name: lvm-make-log_area-a-list.patch
>
> The 'alloc_handle' structure only has space for one log_area.
> We change that to a list to allow an arbitrary number of
> log areas.
>
> RFC: Jonathan Brassow <jbrassow@redhat.com>
>
> @@ -1061,10 +1065,14 @@ static int _find_parallel_space(struct a
> continue; /* Next PV */
>
> if (alloc != ALLOC_ANYWHERE) {
> - /* Don't allocate onto the log pv */
> - if (ah->log_count &&
> - pvm->pv == ah->log_area.pv)
> - continue; /* Next PV */
> + /* Don't allocate onto the log pvs */
> + dm_list_iterate_items(aa, &ah->log_areas)
> + if (pvm->pv == aa->pv)
> + skip = 1;
You can 'break' soon after setting skip.
> @@ -1199,6 +1208,7 @@ static int _allocate(struct alloc_handle
> struct dm_list *pvms;
> uint32_t areas_size;
> alloc_policy_t alloc;
> + struct alloced_area *aa;
>
> if (allocated >= new_extents && !ah->log_count) {
> log_error("_allocate called with no work to do!");
> @@ -1264,12 +1274,13 @@ static int _allocate(struct alloc_handle
> goto out;
> }
>
> - if (ah->log_count && !ah->log_area.len) {
> - log_error("Insufficient extents for log allocation "
> - "for logical volume %s.",
> - lv ? lv->name : "");
> - goto out;
> - }
> + dm_list_iterate_items(aa, &ah->log_areas)
> + if (ah->log_count && !aa->len) {
ah->log_count can be checked outside of the list iterate.
> + log_error("Insufficient extents for log allocation "
> + "for logical volume %s.",
> + lv ? lv->name : "");
> + goto out;
> + }
> int lv_add_log_segment(struct alloc_handle *ah, struct logical_volume *log_lv)
> {
> struct lv_segment *seg;
> + struct alloced_area *log_area;
> +
> + dm_list_iterate_items(log_area, &ah->log_areas)
> + break;
Using the list iterator to get the first element looks odd!
Should we use dm_list_first and dm_list_item? Or just have
dm_list_first_item()???
--
lvm-devel mailing list
lvm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel
WARNING: multiple messages have this Message-ID (diff)
From: malahal@us.ibm.com <malahal@us.ibm.com>
To: lvm-devel@redhat.com
Subject: Re: [PATCH 2 of 10] LVM: make log_area a list
Date: Mon, 12 Oct 2009 18:48:20 -0700 [thread overview]
Message-ID: <20091013014820.GA27349@us.ibm.com> (raw)
In-Reply-To: <200910082118.n98LIaik014287@hydrogen.msp.redhat.com>
Jonathan Brassow [jbrassow at redhat.com] wrote:
> Patch name: lvm-make-log_area-a-list.patch
>
> The 'alloc_handle' structure only has space for one log_area.
> We change that to a list to allow an arbitrary number of
> log areas.
>
> RFC: Jonathan Brassow <jbrassow@redhat.com>
>
> @@ -1061,10 +1065,14 @@ static int _find_parallel_space(struct a
> continue; /* Next PV */
>
> if (alloc != ALLOC_ANYWHERE) {
> - /* Don't allocate onto the log pv */
> - if (ah->log_count &&
> - pvm->pv == ah->log_area.pv)
> - continue; /* Next PV */
> + /* Don't allocate onto the log pvs */
> + dm_list_iterate_items(aa, &ah->log_areas)
> + if (pvm->pv == aa->pv)
> + skip = 1;
You can 'break' soon after setting skip.
> @@ -1199,6 +1208,7 @@ static int _allocate(struct alloc_handle
> struct dm_list *pvms;
> uint32_t areas_size;
> alloc_policy_t alloc;
> + struct alloced_area *aa;
>
> if (allocated >= new_extents && !ah->log_count) {
> log_error("_allocate called with no work to do!");
> @@ -1264,12 +1274,13 @@ static int _allocate(struct alloc_handle
> goto out;
> }
>
> - if (ah->log_count && !ah->log_area.len) {
> - log_error("Insufficient extents for log allocation "
> - "for logical volume %s.",
> - lv ? lv->name : "");
> - goto out;
> - }
> + dm_list_iterate_items(aa, &ah->log_areas)
> + if (ah->log_count && !aa->len) {
ah->log_count can be checked outside of the list iterate.
> + log_error("Insufficient extents for log allocation "
> + "for logical volume %s.",
> + lv ? lv->name : "");
> + goto out;
> + }
> int lv_add_log_segment(struct alloc_handle *ah, struct logical_volume *log_lv)
> {
> struct lv_segment *seg;
> + struct alloced_area *log_area;
> +
> + dm_list_iterate_items(log_area, &ah->log_areas)
> + break;
Using the list iterator to get the first element looks odd!
Should we use dm_list_first and dm_list_item? Or just have
dm_list_first_item()???
next prev parent reply other threads:[~2009-10-13 1:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 21:18 [PATCH 2 of 10] LVM: make log_area a list Jonathan Brassow
2009-10-08 21:18 ` Jonathan Brassow
2009-10-13 1:48 ` malahal [this message]
2009-10-13 1:48 ` malahal
2009-10-13 21:28 ` Jonathan Brassow
2009-10-14 17:16 ` malahal
2009-10-14 18:58 ` Jonathan Brassow
2009-10-15 22:47 ` Alasdair G Kergon
2009-10-15 23:18 ` Alasdair G Kergon
2009-10-21 20:25 ` Jonathan Brassow
-- strict thread matches above, loose matches on Subject: below --
2010-01-20 2:21 Jonathan Brassow
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=20091013014820.GA27349@us.ibm.com \
--to=malahal@us.ibm.com \
--cc=dm-devel@redhat.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.