[Ocfs2-devel] [PATCH 1/2] fs/ocfs2/dlm: Eliminate update of list_for_each_entry loop cursor

Dan Carpenter error27 at gmail.com
Thu Aug 12 00:14:31 PDT 2010


On Thu, Aug 12, 2010 at 07:46:13AM +0200, Julia Lawall wrote:
> 
> This seems a bit ugly to me, since it exposes the implementation of the 
> list abstraction.  What about the following:
> 
> lock = NULL;
> list_for_each_entry(x, tmpq, list) {
> 	if (x->ml.cookie == ml->cookie) {
> 	   	lock = x;
> 		break;
> 	}
> }
> 

I agree with you that it's ugly as pants.  Maybe someone could write an
at_list_start() macro?

regards,
dan carpenter



More information about the Ocfs2-devel mailing list