diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-23 15:19:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:24:15 -0400 |
commit | 1d3382cbf02986e4833849f528d451367ea0b4cb (patch) | |
tree | b754f9903c0f77ce40dcff18030b49d0ce213eab /fs/inode.c | |
parent | a8dade34e3df581bc36ca2afe6e27055e178801c (diff) |
new helper: inode_unhashed()
note: for race-free uses you inode_lock held
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c index db7c74c7dd80..4440cf1034ec 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1094,7 +1094,7 @@ int insert_inode_locked(struct inode *inode) | |||
1094 | __iget(old); | 1094 | __iget(old); |
1095 | spin_unlock(&inode_lock); | 1095 | spin_unlock(&inode_lock); |
1096 | wait_on_inode(old); | 1096 | wait_on_inode(old); |
1097 | if (unlikely(!hlist_unhashed(&old->i_hash))) { | 1097 | if (unlikely(!inode_unhashed(old))) { |
1098 | iput(old); | 1098 | iput(old); |
1099 | return -EBUSY; | 1099 | return -EBUSY; |
1100 | } | 1100 | } |
@@ -1133,7 +1133,7 @@ int insert_inode_locked4(struct inode *inode, unsigned long hashval, | |||
1133 | __iget(old); | 1133 | __iget(old); |
1134 | spin_unlock(&inode_lock); | 1134 | spin_unlock(&inode_lock); |
1135 | wait_on_inode(old); | 1135 | wait_on_inode(old); |
1136 | if (unlikely(!hlist_unhashed(&old->i_hash))) { | 1136 | if (unlikely(!inode_unhashed(old))) { |
1137 | iput(old); | 1137 | iput(old); |
1138 | return -EBUSY; | 1138 | return -EBUSY; |
1139 | } | 1139 | } |
@@ -1186,7 +1186,7 @@ EXPORT_SYMBOL(generic_delete_inode); | |||
1186 | */ | 1186 | */ |
1187 | int generic_drop_inode(struct inode *inode) | 1187 | int generic_drop_inode(struct inode *inode) |
1188 | { | 1188 | { |
1189 | return !inode->i_nlink || hlist_unhashed(&inode->i_hash); | 1189 | return !inode->i_nlink || inode_unhashed(inode); |
1190 | } | 1190 | } |
1191 | EXPORT_SYMBOL_GPL(generic_drop_inode); | 1191 | EXPORT_SYMBOL_GPL(generic_drop_inode); |
1192 | 1192 | ||