From 756acc2d61712a8cafe2aa6ad626c60a185d3645 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 23 Oct 2010 15:23:40 -0400 Subject: list.h: new helper - hlist_add_fake() Make node look as if it was on hlist, with hlist_del() working correctly. Usable without any locking... Convert a couple of places where we want to do that to inode->i_hash. Signed-off-by: Al Viro --- include/linux/list.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/list.h') diff --git a/include/linux/list.h b/include/linux/list.h index 88a000617d7..9a5f8a71810 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -636,6 +636,12 @@ static inline void hlist_add_after(struct hlist_node *n, next->next->pprev = &next->next; } +/* after that we'll appear to be on some hlist and hlist_del will work */ +static inline void hlist_add_fake(struct hlist_node *n) +{ + n->pprev = &n->next; +} + /* * Move a list from one list head to another. Fixup the pprev * reference of the first entry if it exists. -- cgit v1.2.3