Re: [PATCHv3 3/6] mm/zpool: implement common zpool api to zbud/zsmalloc

From: Seth Jennings
Date: Tue May 27 2014 - 18:48:18 EST


On Tue, May 27, 2014 at 05:06:39PM -0500, Seth Jennings wrote:
> On Sat, May 24, 2014 at 03:06:06PM -0400, Dan Streetman wrote:
<snip>
> > +
> > +int zpool_evict(void *pool, unsigned long handle)
> > +{
> > + struct zpool *zpool;
> > +
> > + spin_lock(&pools_lock);
> > + list_for_each_entry(zpool, &pools_head, list) {
>
> You can do a container_of() here:
>
> zpool = container_of(pool, struct zpool, pool);

If you do this, all of the pools_head/pools_lock is unneeded as well.

Seth
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/