[lvm-devel] Re: [PATCH 2 of 10] LVM: make log_area a list

malahal at us.ibm.com malahal at us.ibm.com
Wed Oct 14 17:16:09 UTC 2009


Jonathan Brassow [jbrassow at redhat.com] wrote:
>
> On Oct 12, 2009, at 8:48 PM, malahal at us.ibm.com wrote:
>
>> 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 at 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.
>
> If I use 'break' won't that break out of the 'dm_list_iterate_items' and 
> not the enclosing loop - giving an incorrect result?

IIRC, there are two dm_list_iterate_items loops. You can 'break' from the
inner loop after setting 'skip=1' and the next statement will check that
skip is set and execute 'continue' for the outer loop.

My understanding is that the current code executes the inner loop to
completion every time.

Thanks, Malahal.




More information about the lvm-devel mailing list