xfs
[Top] [All Lists]

Re: [PATCH 3/3] xfs: demultiplex xfs_icsb_modify_counters()

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/3] xfs: demultiplex xfs_icsb_modify_counters()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 30 Nov 2010 15:38:17 +1100
Cc: xfs@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, a.p.zijlstra@xxxxxxxxx
In-reply-to: <20101129091920.GB13902@xxxxxxxxxxxxx>
References: <1290991002-18680-1-git-send-email-david@xxxxxxxxxxxxx> <1290991002-18680-4-git-send-email-david@xxxxxxxxxxxxx> <20101129091920.GB13902@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Nov 29, 2010 at 04:19:20AM -0500, Christoph Hellwig wrote:
> On Mon, Nov 29, 2010 at 11:36:41AM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > With the conversion to percpu counters, xfs_icsb_modify_counters() really 
> > does
> > not need to exist. Convert the inode counter modifications to use a common
> > helper function for the one place that calls them, and add another function 
> > for
> > the free block modification and convert all the callers to use that.
> 
> > +xfs_icsb_modify_inodes(
> > +   xfs_mount_t     *mp,
> 
> struct xfs_mount, please.
> 
> > +   int             cntr,
> > +   int64_t         delta,
> > +   int             rsvd)
> 
> the rsvd argument isn't used at all.
> 
> > +{
> > +   int             ret = 0;
> > +
> > +   ASSERT(cntr == XFS_ICSB_ICOUNT || cntr == XFS_ICSB_IFREE);
> > +
> > +   ret = xfs_icsb_add(mp, cntr, delta, 0);
> > +   if (ret < 0) {
> > +           ASSERT(0);
> > +           return XFS_ERROR(EINVAL);
> > +   }
> > +   return 0;
> 
> You could get rdif of the ret argument as we don't care about the
> value.  I also don't think we need the assert here - the caller already
> does one for us.
> 
> > +xfs_icsb_modify_free_blocks(
> > +   xfs_mount_t     *mp,
> 
> same here.

Ok, makes sense. I'll clean it up.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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