[PATCH 3/12] FS-Cache: Add list_for_each_entry_safe_reverse()

From: David Howells (dhowells_at_redhat.com)
Date: 11/14/05

  • Next message: David Howells: "[PATCH 10/12] FS-Cache: Make kAFS use FS-Cache"
    Date:	Mon, 14 Nov 2005 21:54:38 GMT
    To: torvalds@osdl.org, akpm@osdl.org
    
    

    The attached patch adds list_for_each_entry_safe_reverse() to linux/list.h

    Signed-Off-By: David Howells <dhowells@redhat.com>

    ---
    warthog>diffstat -p1 list-foreach-saferev-2614mm2.diff
     include/linux/list.h |   14 ++++++++++++++
     1 files changed, 14 insertions(+)
    diff -uNrp linux-2.6.14-mm2/include/linux/list.h linux-2.6.14-mm2-cachefs/include/linux/list.h
    --- linux-2.6.14-mm2/include/linux/list.h	2005-11-14 16:17:58.000000000 +0000
    +++ linux-2.6.14-mm2-cachefs/include/linux/list.h	2005-11-14 16:23:38.000000000 +0000
    @@ -450,6 +450,20 @@ static inline void list_splice_init(stru
     	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
     
     /**
    + * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against
    + *				      removal of list entry
    + * @pos:	the type * to use as a loop counter.
    + * @n:		another type * to use as temporary storage
    + * @head:	the head for your list.
    + * @member:	the name of the list_struct within the struct.
    + */
    +#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
    +	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
    +		n = list_entry(pos->member.prev, typeof(*pos), member);	\
    +	     &pos->member != (head); 					\
    +	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
    +
    +/**
      * list_for_each_rcu	-	iterate over an rcu-protected list
      * @pos:	the &struct list_head to use as a loop counter.
      * @head:	the head for your list.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: David Howells: "[PATCH 10/12] FS-Cache: Make kAFS use FS-Cache"

    Relevant Pages

    • Re: XFS breakage in 2.6.18-rc1
      ... system disk too who had to take the hit. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: How to run an a.out file in a kernel module
      ... called in a kernel module using call_usermodehelper ... Please read the FAQ at http://www.tux.org/lkml/ ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: XFS Bug null pointer dereference in xfs_free_ag_extent
      ... I also filed bug 6877 at kernel.org ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [patch] remove unused acct variables from task_struct
      ... struct mempolicy *mempolicy; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: DIPC alpha2 for i386, Alpha, SPARC, and M68k
      ... there seems to be a delay on cs.uwindsor.ca between the time you upload something and the time it actually shows up on the page. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)