summaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-10-23 15:23:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:24:15 -0400
commit756acc2d61712a8cafe2aa6ad626c60a185d3645 (patch)
tree72473307f7789b2dafa4b7ca2facc6427f83a283 /include/linux/list.h
parent1d3382cbf02986e4833849f528d451367ea0b4cb (diff)
downloadblackbird-op-linux-756acc2d61712a8cafe2aa6ad626c60a185d3645.tar.gz
blackbird-op-linux-756acc2d61712a8cafe2aa6ad626c60a185d3645.zip
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 88a000617d77..9a5f8a71810c 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.
OpenPOWER on IntegriCloud