xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 6/6] xfs: push the AIL from memory reclaim and periodic sync
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 10 Mar 2011 16:31:44 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1299715529-11026-7-git-send-email-david@xxxxxxxxxxxxx>
References: <1299715529-11026-1-git-send-email-david@xxxxxxxxxxxxx> <1299715529-11026-7-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
> -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.

> @@ -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.

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