xfs
[Top] [All Lists]

Re: [PATCH 02/12] xfs: Remove the macro XFS_BUF_ZEROFLAGS

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH 02/12] xfs: Remove the macro XFS_BUF_ZEROFLAGS
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 22 Jul 2011 11:18:05 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1311269391.3210.956.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20110716012105.6629.24407.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110716012116.6629.48217.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110716015901.GC589@xxxxxxxxxxxxx> <1311269391.3210.956.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Jul 21, 2011 at 10:29:51AM -0700, Chandra Seetharaman wrote:
> > >   XFS_BUF_SET_COUNT(bp, count);
> > >   XFS_BUF_SET_FSPRIVATE(bp, iclog);       /* save for later */
> > > - XFS_BUF_ZEROFLAGS(bp);
> > > + bp->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI|XBF_ORDERED);
> > >   XFS_BUF_BUSY(bp);
> > >   XFS_BUF_ASYNC(bp);
> > >   bp->b_flags |= XBF_LOG_BUFFER;
> > 
> > Note that XBF_ORDERED is gone in the current tree, you need to rebase
> > your patches to pick up the buffer changes I recently sent out.
> > 
> > I don't link this blind expansion.  For one all that flag setting is
> > duplicated in two places in xlog_sync, please send a patch to
> > consolidate it in xlog_bdstrat.  Second XBF_READ and XBF_DELWRI
> 
> The two places are using 2 different bps, how do you want it to be
> consolidated in xlog_bdstrat() ?

xlog_bdstrate is called for both buffers, so any code that's the same
for both can be moved into it.  If you don't want to go down to that
level just leave the macro in for your next series, and I'll fix it
later.

> It looks cleaner if I just have those flags cleared above, instead of
> conditionally clearing them, what do you think ?

I don't really care either way.

> > XBF_READ, XBF_WRITE, XBF_ASYNC and XBF_DELWRI already get dealt with
> > in xfs_bwrite a few lines down, and XBF_ORDERED can't be set here. IOW
> > this line can simply be removed.
> 
> New definition of XFS_BUF_ZEROFLAGS has these: XBF_SYNCIO, XBF_FUA, and
> XBF_FLUSH. In this context is it ok to not clear those ?

Yes, all these are only ever set on log buffers.

<Prev in Thread] Current Thread [Next in Thread>