xfs
[Top] [All Lists]

Re: [PATCH 4/5] xfs: convert AIL cursors to use struct list_head

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/5] xfs: convert AIL cursors to use struct list_head
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 4 Jul 2011 04:43:16 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1309757260-5484-5-git-send-email-david@xxxxxxxxxxxxx>
References: <1309757260-5484-1-git-send-email-david@xxxxxxxxxxxxx> <1309757260-5484-5-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jul 04, 2011 at 03:27:39PM +1000, Dave Chinner wrote:
>  /*
>   * AIL traversal cursor initialisation.
>   *
> + * The cursor keeps track of where our current traversal is up to by tracking
> + * the next ??tem in the list for us. However, for this to be safe, removing 
> an
               ^^
Non-ASCSI character.

> + * object from the AIL needs to invalidate any cursor that points to it. 
> hence
> + * the traversal cursor needs to be linked to the struct xfs_ail so that
> + * deletion can search all the active cursors for invalidation.
>   */
>  STATIC void
>  xfs_trans_ail_cursor_init(
> @@ -181,17 +177,13 @@ xfs_trans_ail_cursor_init(
>       struct xfs_ail_cursor   *cur)
>  {
>       cur->item = NULL;
> -     if (cur == &ailp->xa_cursors)
> -             return;
> -
> -     cur->next = ailp->xa_cursors.next;
> -     ailp->xa_cursors.next = cur;
> +     INIT_LIST_HEAD(&cur->list);
> +     list_add_tail(&cur->list, &ailp->xa_cursors);
>  }

There is no need to initialize a list_head before adding it to a list.

Otherwise looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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