Commit b650c858c26bd9ba29ebc82d30f09355845a294a

Authored by David Howells
Committed by Al Viro
1 parent ea5b778a8b

autofs4: Merge the remaining dentry ops tables

Merge the remaining autofs4 dentry ops tables.  It doesn't matter if
d_automount and d_manage are present on something that's not mountable or
holdable as these ops are only used if the appropriate flags are set in
dentry->d_flags.

[AV] switch to ->s_d_op, since now _everything_ on autofs4 is using the
same dentry_operations.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 3 changed files with 4 additions and 20 deletions Side-by-side Diff

fs/autofs4/autofs_i.h
... ... @@ -207,7 +207,6 @@
207 207 extern const struct file_operations autofs4_dir_operations;
208 208 extern const struct file_operations autofs4_root_operations;
209 209 extern const struct dentry_operations autofs4_dentry_operations;
210   -extern const struct dentry_operations autofs4_mount_dentry_operations;
211 210  
212 211 /* VFS automount flags management functions */
213 212  
... ... @@ -276,6 +276,7 @@
276 276 s->s_blocksize_bits = 10;
277 277 s->s_magic = AUTOFS_SUPER_MAGIC;
278 278 s->s_op = &autofs4_sops;
  279 + s->s_d_op = &autofs4_dentry_operations;
279 280 s->s_time_gran = 1;
280 281  
281 282 /*
... ... @@ -293,7 +294,6 @@
293 294 goto fail_iput;
294 295 pipe = NULL;
295 296  
296   - d_set_d_op(root, &autofs4_dentry_operations);
297 297 root->d_fsdata = ino;
298 298  
299 299 /* Can this call block? */
300 300  
... ... @@ -304,10 +304,8 @@
304 304 goto fail_dput;
305 305 }
306 306  
307   - if (autofs_type_trigger(sbi->type)) {
308   - d_set_d_op(root, &autofs4_mount_dentry_operations);
  307 + if (autofs_type_trigger(sbi->type))
309 308 __managed_dentry_set_managed(root);
310   - }
311 309  
312 310 root_inode->i_fop = &autofs4_root_operations;
313 311 root_inode->i_op = &autofs4_dir_inode_operations;
... ... @@ -66,13 +66,7 @@
66 66 .rmdir = autofs4_dir_rmdir,
67 67 };
68 68  
69   -/* For dentries that don't initiate mounting */
70 69 const struct dentry_operations autofs4_dentry_operations = {
71   - .d_release = autofs4_dentry_release,
72   -};
73   -
74   -/* For dentries that do initiate mounting */
75   -const struct dentry_operations autofs4_mount_dentry_operations = {
76 70 .d_automount = autofs4_d_automount,
77 71 .d_manage = autofs4_d_manage,
78 72 .d_release = autofs4_dentry_release,
... ... @@ -500,8 +494,6 @@
500 494 if (active) {
501 495 return active;
502 496 } else {
503   - d_set_d_op(dentry, &autofs4_dentry_operations);
504   -
505 497 /*
506 498 * A dentry that is not within the root can never trigger a
507 499 * mount operation, unless the directory already exists, so we
508 500  
... ... @@ -512,10 +504,8 @@
512 504 return ERR_PTR(-ENOENT);
513 505  
514 506 /* Mark entries in the root as mount triggers */
515   - if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent)) {
516   - d_set_d_op(dentry, &autofs4_mount_dentry_operations);
  507 + if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
517 508 __managed_dentry_set_managed(dentry);
518   - }
519 509  
520 510 ino = autofs4_init_ino(NULL, sbi, 0555);
521 511 if (!ino)
... ... @@ -572,8 +562,6 @@
572 562 }
573 563 d_add(dentry, inode);
574 564  
575   - d_set_d_op(dentry, &autofs4_dentry_operations);
576   -
577 565 dentry->d_fsdata = ino;
578 566 ino->dentry = dget(dentry);
579 567 atomic_inc(&ino->count);
... ... @@ -848,8 +836,7 @@
848 836 int is_autofs4_dentry(struct dentry *dentry)
849 837 {
850 838 return dentry && dentry->d_inode &&
851   - (dentry->d_op == &autofs4_mount_dentry_operations ||
852   - dentry->d_op == &autofs4_dentry_operations) &&
  839 + dentry->d_op == &autofs4_dentry_operations &&
853 840 dentry->d_fsdata != NULL;
854 841 }
855 842