xfs
[Top] [All Lists]

Re: [PATCH 6/6] xfs: push the AIL from memory reclaim and periodic sync

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 6/6] xfs: push the AIL from memory reclaim and periodic sync
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 18 Mar 2011 15:07:22 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110310213144.GA9371@xxxxxxxxxxxxx>
References: <1299715529-11026-1-git-send-email-david@xxxxxxxxxxxxx> <1299715529-11026-7-git-send-email-david@xxxxxxxxxxxxx> <20110310213144.GA9371@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Mar 10, 2011 at 04:31:44PM -0500, Christoph Hellwig wrote:
> > -STATIC void xfs_ail_splice(struct xfs_ail *, struct list_head *, 
> > xfs_lsn_t);
> > -STATIC void xfs_ail_delete(struct xfs_ail *, xfs_log_item_t *);
> > -STATIC xfs_log_item_t * xfs_ail_min(struct xfs_ail *);
> > -STATIC xfs_log_item_t * xfs_ail_next(struct xfs_ail *, xfs_log_item_t *);
> > -
> 
> Reordering and cleanup of unrelated existing functions should be in a
> separate patch.

OK.

> 
> > @@ -55,16 +93,32 @@ xfs_lsn_t
> >  xfs_trans_ail_tail(
> >     struct xfs_ail  *ailp)
> >  {
> > -   xfs_lsn_t       lsn;
> > +   xfs_lsn_t       lsn = 0;
> >     xfs_log_item_t  *lip;
> >  
> >     spin_lock(&ailp->xa_lock);
> >     lip = xfs_ail_min(ailp);
> > -   if (lip == NULL) {
> > -           lsn = (xfs_lsn_t)0;
> > -   } else {
> > +   if (lip)
> > +           lsn = lip->li_lsn;
> > +   spin_unlock(&ailp->xa_lock);
> > +
> > +   return lsn;
> > +}
> > +
> > +/*
> > + * Return the maximum lsn held in the AIL, or zero if the AIl is empty.
> > + */
> > +static xfs_lsn_t
> > +xfs_ail_max_lsn(
> > +   struct xfs_ail  *ailp)
> > +{
> > +   xfs_lsn_t       lsn = 0;
> > +   xfs_log_item_t  *lip;
> > +
> > +   spin_lock(&ailp->xa_lock);
> > +   lip = xfs_ail_max(ailp);
> > +   if (lip)
> 
> As this is the counterpart to xfs_trans_ail_tail the naming for both
> should be similar.  I much prefer the descriptive _lsn naming over the
> random trans in xfs_trans_ail_tail.

Ok, will change.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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