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>
This commit is contained in:
Al Viro 2010-10-23 15:23:40 -04:00
parent 1d3382cbf0
commit 756acc2d61
3 changed files with 8 additions and 2 deletions

View file

@ -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.