mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
new helper: inode_unhashed()
note: for race-free uses you inode_lock held Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a8dade34e3
commit
1d3382cbf0
6 changed files with 13 additions and 8 deletions
|
|
@ -2146,7 +2146,7 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
|
|||
if (*len < 3)
|
||||
return 255;
|
||||
|
||||
if (hlist_unhashed(&inode->i_hash)) {
|
||||
if (inode_unhashed(inode)) {
|
||||
/* Unfortunately insert_inode_hash is not idempotent,
|
||||
* so as we hash inodes here rather than at creation
|
||||
* 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,
|
|||
*/
|
||||
static DEFINE_SPINLOCK(lock);
|
||||
spin_lock(&lock);
|
||||
if (hlist_unhashed(&inode->i_hash))
|
||||
if (inode_unhashed(inode))
|
||||
__insert_inode_hash(inode,
|
||||
inode->i_ino + inode->i_generation);
|
||||
spin_unlock(&lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue