[Ocfs2-devel] [PATCH 1/3] ocfs2/dlm: dlm_is_lockres_migrateable() returns boolean

Sunil Mushran sunil.mushran at oracle.com
Thu May 5 15:15:34 PDT 2011


On 05/05/2011 03:09 PM, Mark Fasheh wrote:
> On Tue, Apr 26, 2011 at 04:03:23PM -0700, Sunil Mushran wrote:
>>
>> -	*numlocks = count;
>> -
>> -	count = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
>> -	if (count<  O2NM_MAX_NODES)
>> -		*hasrefs = 1;
>> +	if (!nonlocal) {
>> +		nonlocal = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
>> +		if (nonlocal>= O2NM_MAX_NODES)
>> +			return 0;
> Minor quibble, but can you use a new variable for these two lines? It took
> me a minute to realize that what you were doing was gettting a refcount on
> the lockres. Maybe:
>
> if (!nonlocal) {
> 	/*
> 	 * We have no locks on the resource (local or remote). Check for
> 	 * references now.
> 	 */
> 	node_ref = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
> 	if (node_ref>= O2NM_MAX_NODES)
> 		return 0;
> 	}
> }

ok.



More information about the Ocfs2-devel mailing list