aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-10-23 15:19:20 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:24:15 -0400
commit1d3382cbf02986e4833849f528d451367ea0b4cb (patch)
treeb754f9903c0f77ce40dcff18030b49d0ce213eab /fs
parenta8dade34e3df581bc36ca2afe6e27055e178801c (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')
-rw-r--r--fs/btrfs/inode.c2
-rw-r--r--fs/fs-writeback.c2
-rw-r--r--fs/inode.c6
-rw-r--r--fs/reiserfs/xattr.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c03864406af3..f6f2a0da2695 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3849,7 +3849,7 @@ again:
3849 p = &root->inode_tree.rb_node; 3849 p = &root->inode_tree.rb_node;
3850 parent = NULL; 3850 parent = NULL;
3851 3851
3852 if (hlist_unhashed(&inode->i_hash)) 3852 if (inode_unhashed(inode))
3853 return; 3853 return;
3854 3854
3855 spin_lock(&root->inode_lock); 3855 spin_lock(&root->inode_lock);
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 29e3f409bbd0..39f44f2e709a 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -962,7 +962,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
962 * dirty list. Add blockdev inodes as well. 962 * dirty list. Add blockdev inodes as well.
963 */ 963 */
964 if (!S_ISBLK(inode->i_mode)) { 964 if (!S_ISBLK(inode->i_mode)) {
965 if (hlist_unhashed(&inode->i_hash)) 965 if (inode_unhashed(inode))
966 goto out; 966 goto out;
967 } 967 }
968 if (inode->i_state & I_FREEING) 968 if (inode->i_state & I_FREEING)
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 */
1187int generic_drop_inode(struct inode *inode) 1187int 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}
1191EXPORT_SYMBOL_GPL(generic_drop_inode); 1191EXPORT_SYMBOL_GPL(generic_drop_inode);
1192 1192
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index f7415de13878..5d04a7828e7a 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -422,7 +422,7 @@ int reiserfs_commit_write(struct file *f, struct page *page,
422static void update_ctime(struct inode *inode) 422static void update_ctime(struct inode *inode)
423{ 423{
424 struct timespec now = current_fs_time(inode->i_sb); 424 struct timespec now = current_fs_time(inode->i_sb);
425 if (hlist_unhashed(&inode->i_hash) || !inode->i_nlink || 425 if (inode_unhashed(inode) || !inode->i_nlink ||
426 timespec_equal(&inode->i_ctime, &now)) 426 timespec_equal(&inode->i_ctime, &now))
427 return; 427 return;
428 428