diff options
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r-- | fs/autofs4/root.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 27e17f96cada..c1493524da4d 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -281,9 +281,6 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags) | |||
281 | 281 | ||
282 | DPRINTK("mount done status=%d", status); | 282 | DPRINTK("mount done status=%d", status); |
283 | 283 | ||
284 | if (status && dentry->d_inode) | ||
285 | return status; /* Try to get the kernel to invalidate this dentry */ | ||
286 | |||
287 | /* Turn this into a real negative dentry? */ | 284 | /* Turn this into a real negative dentry? */ |
288 | if (status == -ENOENT) { | 285 | if (status == -ENOENT) { |
289 | spin_lock(&dentry->d_lock); | 286 | spin_lock(&dentry->d_lock); |
@@ -359,7 +356,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
359 | * don't try to mount it again. | 356 | * don't try to mount it again. |
360 | */ | 357 | */ |
361 | spin_lock(&dcache_lock); | 358 | spin_lock(&dcache_lock); |
362 | if (!d_mountpoint(dentry) && list_empty(&dentry->d_subdirs)) { | 359 | if (!d_mountpoint(dentry) && __simple_empty(dentry)) { |
363 | spin_unlock(&dcache_lock); | 360 | spin_unlock(&dcache_lock); |
364 | 361 | ||
365 | status = try_to_fill_dentry(dentry, 0); | 362 | status = try_to_fill_dentry(dentry, 0); |
@@ -540,6 +537,9 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s | |||
540 | return ERR_PTR(-ERESTARTNOINTR); | 537 | return ERR_PTR(-ERESTARTNOINTR); |
541 | } | 538 | } |
542 | } | 539 | } |
540 | spin_lock(&dentry->d_lock); | ||
541 | dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; | ||
542 | spin_unlock(&dentry->d_lock); | ||
543 | } | 543 | } |
544 | 544 | ||
545 | /* | 545 | /* |
@@ -638,7 +638,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry) | |||
638 | dput(ino->dentry); | 638 | dput(ino->dentry); |
639 | 639 | ||
640 | dentry->d_inode->i_size = 0; | 640 | dentry->d_inode->i_size = 0; |
641 | dentry->d_inode->i_nlink = 0; | 641 | clear_nlink(dentry->d_inode); |
642 | 642 | ||
643 | dir->i_mtime = CURRENT_TIME; | 643 | dir->i_mtime = CURRENT_TIME; |
644 | 644 | ||
@@ -673,10 +673,10 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry) | |||
673 | } | 673 | } |
674 | dput(ino->dentry); | 674 | dput(ino->dentry); |
675 | dentry->d_inode->i_size = 0; | 675 | dentry->d_inode->i_size = 0; |
676 | dentry->d_inode->i_nlink = 0; | 676 | clear_nlink(dentry->d_inode); |
677 | 677 | ||
678 | if (dir->i_nlink) | 678 | if (dir->i_nlink) |
679 | dir->i_nlink--; | 679 | drop_nlink(dir); |
680 | 680 | ||
681 | return 0; | 681 | return 0; |
682 | } | 682 | } |
@@ -713,7 +713,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
713 | if (p_ino && dentry->d_parent != dentry) | 713 | if (p_ino && dentry->d_parent != dentry) |
714 | atomic_inc(&p_ino->count); | 714 | atomic_inc(&p_ino->count); |
715 | ino->inode = inode; | 715 | ino->inode = inode; |
716 | dir->i_nlink++; | 716 | inc_nlink(dir); |
717 | dir->i_mtime = CURRENT_TIME; | 717 | dir->i_mtime = CURRENT_TIME; |
718 | 718 | ||
719 | return 0; | 719 | return 0; |