aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r--fs/autofs4/root.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index dbd95512808..1dba035fc37 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -66,13 +66,7 @@ const struct inode_operations autofs4_dir_inode_operations = {
66 .rmdir = autofs4_dir_rmdir, 66 .rmdir = autofs4_dir_rmdir,
67}; 67};
68 68
69/* For dentries that don't initiate mounting */
70const struct dentry_operations autofs4_dentry_operations = { 69const struct dentry_operations autofs4_dentry_operations = {
71 .d_release = autofs4_dentry_release,
72};
73
74/* For dentries that do initiate mounting */
75const struct dentry_operations autofs4_mount_dentry_operations = {
76 .d_automount = autofs4_d_automount, 70 .d_automount = autofs4_d_automount,
77 .d_manage = autofs4_d_manage, 71 .d_manage = autofs4_d_manage,
78 .d_release = autofs4_dentry_release, 72 .d_release = autofs4_dentry_release,
@@ -500,8 +494,6 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
500 if (active) { 494 if (active) {
501 return active; 495 return active;
502 } else { 496 } else {
503 d_set_d_op(dentry, &autofs4_dentry_operations);
504
505 /* 497 /*
506 * A dentry that is not within the root can never trigger a 498 * A dentry that is not within the root can never trigger a
507 * mount operation, unless the directory already exists, so we 499 * mount operation, unless the directory already exists, so we
@@ -512,10 +504,8 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
512 return ERR_PTR(-ENOENT); 504 return ERR_PTR(-ENOENT);
513 505
514 /* Mark entries in the root as mount triggers */ 506 /* Mark entries in the root as mount triggers */
515 if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent)) { 507 if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
516 d_set_d_op(dentry, &autofs4_mount_dentry_operations);
517 __managed_dentry_set_managed(dentry); 508 __managed_dentry_set_managed(dentry);
518 }
519 509
520 ino = autofs4_init_ino(NULL, sbi, 0555); 510 ino = autofs4_init_ino(NULL, sbi, 0555);
521 if (!ino) 511 if (!ino)
@@ -572,8 +562,6 @@ static int autofs4_dir_symlink(struct inode *dir,
572 } 562 }
573 d_add(dentry, inode); 563 d_add(dentry, inode);
574 564
575 d_set_d_op(dentry, &autofs4_dentry_operations);
576
577 dentry->d_fsdata = ino; 565 dentry->d_fsdata = ino;
578 ino->dentry = dget(dentry); 566 ino->dentry = dget(dentry);
579 atomic_inc(&ino->count); 567 atomic_inc(&ino->count);
@@ -848,8 +836,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
848int is_autofs4_dentry(struct dentry *dentry) 836int is_autofs4_dentry(struct dentry *dentry)
849{ 837{
850 return dentry && dentry->d_inode && 838 return dentry && dentry->d_inode &&
851 (dentry->d_op == &autofs4_mount_dentry_operations || 839 dentry->d_op == &autofs4_dentry_operations &&
852 dentry->d_op == &autofs4_dentry_operations) &&
853 dentry->d_fsdata != NULL; 840 dentry->d_fsdata != NULL;
854} 841}
855 842