xfs
[Top] [All Lists]

Re: [PATCH 2/5] xfs: use a cursor for bulk AIL insertion

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/5] xfs: use a cursor for bulk AIL insertion
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 4 Jul 2011 04:32:06 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1309757260-5484-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1309757260-5484-1-git-send-email-david@xxxxxxxxxxxxx> <1309757260-5484-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
>  /*
> + * Initialise the cursor to the last item in the AIL with the given @lsn.
> + * This searches the list from highest LSN to lowest.
>   */
> +static struct xfs_log_item *
> +__xfs_trans_ail_cursor_last(
> +     struct xfs_ail          *ailp,
> +     struct xfs_ail_cursor   *cur,
> +     xfs_lsn_t               lsn,
> +     bool                    do_init)
>  {
> +     xfs_log_item_t          *lip = NULL;
>  
> +     if (do_init)
> +             xfs_trans_ail_cursor_init(ailp, cur);
> +
> +     if (list_empty(&ailp->xa_ail)) 
> +             goto out;
>  
> +     list_for_each_entry_reverse(lip, &ailp->xa_ail, li_ail) {
> +             if (XFS_LSN_CMP(lip->li_lsn, lsn) <= 0)
>                       break;
>       }
> +out:
> +     if (cur)
> +             cur->item = lip;
> +     return lip;
> +}

Please just move the xfs_trans_ail_cursor_init call to
xfs_trans_ail_cursor_init instead of adding the do_init parameter.
Also the list_empty check is not needed due to the list_for_each*
macros handling that case just fine.

I haven't looked at the details of the new xfs_ail_splice code yet, so
more updates later.

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