extern const struct file_operations autofs4_dir_operations;
extern const struct file_operations autofs4_root_operations;
extern const struct dentry_operations autofs4_dentry_operations;
-extern const struct dentry_operations autofs4_mount_dentry_operations;
/* VFS automount flags management functions */
s->s_blocksize_bits = 10;
s->s_magic = AUTOFS_SUPER_MAGIC;
s->s_op = &autofs4_sops;
+ s->s_d_op = &autofs4_dentry_operations;
s->s_time_gran = 1;
/*
goto fail_iput;
pipe = NULL;
- d_set_d_op(root, &autofs4_dentry_operations);
root->d_fsdata = ino;
/* Can this call block? */
goto fail_dput;
}
- if (autofs_type_trigger(sbi->type)) {
- d_set_d_op(root, &autofs4_mount_dentry_operations);
+ if (autofs_type_trigger(sbi->type))
__managed_dentry_set_managed(root);
- }
root_inode->i_fop = &autofs4_root_operations;
root_inode->i_op = &autofs4_dir_inode_operations;
.rmdir = autofs4_dir_rmdir,
};
-/* For dentries that don't initiate mounting */
const struct dentry_operations autofs4_dentry_operations = {
- .d_release = autofs4_dentry_release,
-};
-
-/* For dentries that do initiate mounting */
-const struct dentry_operations autofs4_mount_dentry_operations = {
.d_automount = autofs4_d_automount,
.d_manage = autofs4_d_manage,
.d_release = autofs4_dentry_release,
if (active) {
return active;
} else {
- d_set_d_op(dentry, &autofs4_dentry_operations);
-
/*
* A dentry that is not within the root can never trigger a
* mount operation, unless the directory already exists, so we
return ERR_PTR(-ENOENT);
/* Mark entries in the root as mount triggers */
- if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent)) {
- d_set_d_op(dentry, &autofs4_mount_dentry_operations);
+ if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
__managed_dentry_set_managed(dentry);
- }
ino = autofs4_init_ino(NULL, sbi, 0555);
if (!ino)
}
d_add(dentry, inode);
- d_set_d_op(dentry, &autofs4_dentry_operations);
-
dentry->d_fsdata = ino;
ino->dentry = dget(dentry);
atomic_inc(&ino->count);
int is_autofs4_dentry(struct dentry *dentry)
{
return dentry && dentry->d_inode &&
- (dentry->d_op == &autofs4_mount_dentry_operations ||
- dentry->d_op == &autofs4_dentry_operations) &&
+ dentry->d_op == &autofs4_dentry_operations &&
dentry->d_fsdata != NULL;
}