Re: [PATCH v11 10/63] xarray: Add xa_for_each

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

 



On Fri, Apr 20, 2018 at 07:00:47AM -0500, Goldwyn Rodrigues wrote:
> > +/**
> > + * xas_for_each_tag() - Iterate over a range of an XArray
> > + * @xas: XArray operation state.
> > + * @entry: Entry retrieved from array.
> > + * @max: Maximum index to retrieve from array.
> > + * @tag: Tag to search for.
> > + *
> > + * The loop body will be executed for each tagged entry in the xarray
> > + * between the current xas position and @max.  @entry will be set to
> > + * the entry retrieved from the xarray.  It is safe to delete entries
> > + * from the array in the loop body.  You should hold either the RCU lock
> > + * or the xa_lock while iterating.  If you need to drop the lock, call
> > + * xas_pause() first.
> > + */
> > +#define xas_for_each_tag(xas, entry, max, tag) \
> > +	for (entry = xas_find_tag(xas, max, tag); entry; \
> > +	     entry = xas_next_tag(xas, max, tag))
> > +
> 
> This function name sounds like you are performing the operation for each
> tag.
> 
> Can it be called xas_for_each_tagged() or xas_tag_for_each() instead?

I hadn't thought of that interpretation.  Yes, that makes sense.
Should we also rename xas_find_tag -> xas_find_tagged and xas_next_tag
-> xas_next_tagged?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux