Re: [PATCH 1/3] xfs: use atomic operations to handle xfs_log_item flags

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

 



On Mon, May 22, 2017 at 12:11:11PM -0700, Christoph Hellwig wrote:
> > --- a/fs/xfs/xfs_buf_item.c
> > +++ b/fs/xfs/xfs_buf_item.c
> > @@ -587,7 +587,7 @@ xfs_buf_item_unlock(
> >  	 * (cancelled) buffers at unpin time, but we'll never go through the
> >  	 * pin/unpin cycle if we abort inside commit.
> >  	 */
> > -	aborted = (lip->li_flags & XFS_LI_ABORTED) ? true : false;
> > +	aborted = (test_bit(XFS_LI_ABORTED, &lip->li_flags)) ? true : false;
> 
> 	aborted = test_bit(XFS_LI_ABORTED, &lip->li_flags);
> 
> does the same job in a slightly simpler way.
> 
> > +	ASSERT(!(test_bit(XFS_LI_IN_AIL, &bip->bli_item.li_flags)));
> 
> no need for the inner braces.
> 
> > +		ASSERT(!(test_bit(XFS_LI_IN_AIL, &ip->i_itemp->ili_item.li_flags)));
> 
> Same here.  Also please don't break lines after 80 characters.

Btw, I believe you meant I didn't break the line here? Removing the inner braces
will leave it with 82 chars, I wonder if it's worth to break the line here in
this case? Just looks harder to read with the line broken for just 2 chars.


> 
> > +	       !(test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags)));
> 
> Also no need for the braces around test_bit here.
> 
> > +	if (!(test_bit(XFS_LI_IN_AIL, &lip->li_flags))) {
> 
> .. again
> 
> > +		ASSERT(!(test_bit(XFS_LI_IN_AIL, &bip->bli_item.li_flags)));
> 
> .. again
> 
> Also last but not least the arguments to the *_bit functions are
> bit indices, so they should be renumber to 0 and 1 (and the tracing
> helpers will need some updates as well).

-- 
Carlos
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux