diff options
author | Ian Kent <raven@themaw.net> | 2011-01-14 18:45:58 +0000 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-15 20:07:37 -0500 |
commit | 10584211e48036182212b598cc53331776406d60 (patch) | |
tree | b66067b47a1104c3ae3ccd4248c9b41d5b869c5e /fs/autofs4/expire.c | |
parent | db3729153e82ba3ada89681f26c4f1b6d6807a80 (diff) |
autofs4: Add d_automount() dentry operation
Add a function to use the newly defined ->d_automount() dentry operation
for triggering mounts instead of doing the user space callback in ->lookup()
and ->d_revalidate().
Note, to be useful the subsequent patch to add the ->d_manage() dentry
operation is also needed so the discussion of functionality is deferred to
that patch.
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4/expire.c')
-rw-r--r-- | fs/autofs4/expire.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index 6a930b90d38..0571ec8352b 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c @@ -300,6 +300,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb, spin_unlock(&root->d_lock); } ino->flags |= AUTOFS_INF_EXPIRING; + managed_dentry_set_automount(root); init_completion(&ino->expire_complete); spin_unlock(&sbi->fs_lock); return root; @@ -408,6 +409,7 @@ found: expired, (int)expired->d_name.len, expired->d_name.name); ino = autofs4_dentry_ino(expired); ino->flags |= AUTOFS_INF_EXPIRING; + managed_dentry_set_automount(expired); init_completion(&ino->expire_complete); spin_unlock(&sbi->fs_lock); spin_lock(&autofs4_lock); @@ -479,6 +481,8 @@ int autofs4_expire_run(struct super_block *sb, spin_lock(&sbi->fs_lock); ino = autofs4_dentry_ino(dentry); ino->flags &= ~AUTOFS_INF_EXPIRING; + if (!d_unhashed(dentry)) + managed_dentry_clear_automount(dentry); complete_all(&ino->expire_complete); spin_unlock(&sbi->fs_lock); @@ -516,6 +520,8 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, ino->flags &= ~AUTOFS_INF_MOUNTPOINT; } ino->flags &= ~AUTOFS_INF_EXPIRING; + if (ret) + managed_dentry_clear_automount(dentry); complete_all(&ino->expire_complete); spin_unlock(&sbi->fs_lock); dput(dentry); |