Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vfs: Remove unnecessary calls of check_submounts_and_drop

Now that check_submounts_and_drop can not fail and is called from
d_invalidate there is no longer a need to call check_submounts_and_drom
from filesystem d_revalidate methods so remove it.

Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Eric W. Biederman and committed by
Al Viro
9b053f32 8ed936b5

-26
-5
fs/afs/dir.c
··· 669 669 670 670 out_valid: 671 671 dentry->d_fsdata = dir_version; 672 - out_skip: 673 672 dput(parent); 674 673 key_put(key); 675 674 _leave(" = 1 [valid]"); ··· 681 682 spin_unlock(&dentry->d_lock); 682 683 683 684 out_bad: 684 - /* don't unhash if we have submounts */ 685 - if (check_submounts_and_drop(dentry) != 0) 686 - goto out_skip; 687 - 688 685 _debug("dropping dentry %s/%s", 689 686 parent->d_name.name, dentry->d_name.name); 690 687 dput(parent);
-3
fs/fuse/dir.c
··· 274 274 275 275 invalid: 276 276 ret = 0; 277 - 278 - if (!(flags & LOOKUP_RCU) && check_submounts_and_drop(entry) != 0) 279 - ret = 1; 280 277 goto out; 281 278 } 282 279
-3
fs/gfs2/dentry.c
··· 93 93 if (!had_lock) 94 94 gfs2_glock_dq_uninit(&d_gh); 95 95 invalid: 96 - if (check_submounts_and_drop(dentry) != 0) 97 - goto valid; 98 - 99 96 dput(parent); 100 97 return 0; 101 98
-11
fs/kernfs/dir.c
··· 463 463 goto out_bad; 464 464 465 465 mutex_unlock(&kernfs_mutex); 466 - out_valid: 467 466 return 1; 468 467 out_bad: 469 468 mutex_unlock(&kernfs_mutex); 470 469 out_bad_unlocked: 471 - /* 472 - * @dentry doesn't match the underlying kernfs node, drop the 473 - * dentry and force lookup. If we have submounts we must allow the 474 - * vfs caches to lie about the state of the filesystem to prevent 475 - * leaks and other nasty things, so use check_submounts_and_drop() 476 - * instead of d_drop(). 477 - */ 478 - if (check_submounts_and_drop(dentry) != 0) 479 - goto out_valid; 480 - 481 470 return 0; 482 471 } 483 472
-4
fs/nfs/dir.c
··· 1211 1211 if (IS_ROOT(dentry)) 1212 1212 goto out_valid; 1213 1213 } 1214 - /* If we have submounts, don't unhash ! */ 1215 - if (check_submounts_and_drop(dentry) != 0) 1216 - goto out_valid; 1217 - 1218 1214 dput(parent); 1219 1215 dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", 1220 1216 __func__, dentry);