[Ocfs2-devel] [PATCH 2/2] ocfs2/dlm: Migrate lockres with no locks if it has a reference

Sunil Mushran sunil.mushran at oracle.com
Tue Nov 23 16:22:26 PST 2010


On 11/21/2010 11:57 AM, Joel Becker wrote:
>>   static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,
>>   				      struct dlm_lock_resource *res,
>> -				      int *numlocks)
>> +				      int *numlocks,
>> +				      int *hasrefs)
> 	There's no point in returning hasrefs.  No caller cares about
> *why* it isn't migratable, just that it isn't.  In fact, no caller cares
> about the number of locks, either.  They only care about the boolean
> is/is-not migratable.
> 	I say you remove the numlocks and hasref arguments, and merely
> return 0 when there are locks or refs, 1 otherwise.  -errno for errors,
> of course.

Agreed.

I found further potential for cleanup. My suggestion would be take this
patch as-is as a bug fix. The next patch will have the cleanup.



More information about the Ocfs2-devel mailing list