[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



Jonathan Brassow [jbrassow redhat com] wrote:
>
> On Oct 12, 2009, at 8:48 PM, malahal us ibm com wrote:
>
>> 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.
>
> 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]