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 /mm/shmem.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 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 080b09a57a8f..27a58120dbd5 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2146,7 +2146,7 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, | |||
2146 | if (*len < 3) | 2146 | if (*len < 3) |
2147 | return 255; | 2147 | return 255; |
2148 | 2148 | ||
2149 | if (hlist_unhashed(&inode->i_hash)) { | 2149 | if (inode_unhashed(inode)) { |
2150 | /* Unfortunately insert_inode_hash is not idempotent, | 2150 | /* Unfortunately insert_inode_hash is not idempotent, |
2151 | * so as we hash inodes here rather than at creation | 2151 | * so as we hash inodes here rather than at creation |
2152 | * time, we need a lock to ensure we only try | 2152 | * time, we need a lock to ensure we only try |
@@ -2154,7 +2154,7 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, | |||
2154 | */ | 2154 | */ |
2155 | static DEFINE_SPINLOCK(lock); | 2155 | static DEFINE_SPINLOCK(lock); |
2156 | spin_lock(&lock); | 2156 | spin_lock(&lock); |
2157 | if (hlist_unhashed(&inode->i_hash)) | 2157 | if (inode_unhashed(inode)) |
2158 | __insert_inode_hash(inode, | 2158 | __insert_inode_hash(inode, |
2159 | inode->i_ino + inode->i_generation); | 2159 | inode->i_ino + inode->i_generation); |
2160 | spin_unlock(&lock); | 2160 | spin_unlock(&lock); |