aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/hfsplus/inode.c2
-rw-r--r--fs/jfs/jfs_imap.c2
-rw-r--r--include/linux/list.h6
3 files changed, 8 insertions, 2 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 78449280dae0..8afd7e84f98d 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -211,7 +211,7 @@ static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dent
211 * appear hashed, but do not put on any lists. hlist_del() 211 * appear hashed, but do not put on any lists. hlist_del()
212 * will work fine and require no locking. 212 * will work fine and require no locking.
213 */ 213 */
214 inode->i_hash.pprev = &inode->i_hash.next; 214 hlist_add_fake(&inode->i_hash);
215 215
216 mark_inode_dirty(inode); 216 mark_inode_dirty(inode);
217out: 217out:
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index f8332dc8eeb2..3a09423b6c22 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -497,7 +497,7 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary)
497 * appear hashed, but do not put on any lists. hlist_del() 497 * appear hashed, but do not put on any lists. hlist_del()
498 * will work fine and require no locking. 498 * will work fine and require no locking.
499 */ 499 */
500 ip->i_hash.pprev = &ip->i_hash.next; 500 hlist_add_fake(&ip->i_hash);
501 501
502 return (ip); 502 return (ip);
503} 503}
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,
636 next->next->pprev = &next->next; 636 next->next->pprev = &next->next;
637} 637}
638 638
639/* after that we'll appear to be on some hlist and hlist_del will work */
640static inline void hlist_add_fake(struct hlist_node *n)
641{
642 n->pprev = &n->next;
643}
644
639/* 645/*
640 * Move a list from one list head to another. Fixup the pprev 646 * Move a list from one list head to another. Fixup the pprev
641 * reference of the first entry if it exists. 647 * reference of the first entry if it exists.