diff options
author | Ian Kent <raven@themaw.net> | 2011-01-14 13:45:58 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-15 20:07:37 -0500 |
commit | 10584211e48036182212b598cc53331776406d60 (patch) | |
tree | b66067b47a1104c3ae3ccd4248c9b41d5b869c5e /fs/autofs4/autofs_i.h | |
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/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index eb67953452bb..1ebfe53872b5 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -218,6 +218,36 @@ extern const struct inode_operations autofs4_direct_root_inode_operations; | |||
218 | extern const struct file_operations autofs4_dir_operations; | 218 | extern const struct file_operations autofs4_dir_operations; |
219 | extern const struct file_operations autofs4_root_operations; | 219 | extern const struct file_operations autofs4_root_operations; |
220 | 220 | ||
221 | /* Operations methods */ | ||
222 | |||
223 | struct vfsmount *autofs4_d_automount(struct path *); | ||
224 | |||
225 | /* VFS automount flags management functions */ | ||
226 | |||
227 | static inline void __managed_dentry_set_automount(struct dentry *dentry) | ||
228 | { | ||
229 | dentry->d_flags |= DCACHE_NEED_AUTOMOUNT; | ||
230 | } | ||
231 | |||
232 | static inline void managed_dentry_set_automount(struct dentry *dentry) | ||
233 | { | ||
234 | spin_lock(&dentry->d_lock); | ||
235 | __managed_dentry_set_automount(dentry); | ||
236 | spin_unlock(&dentry->d_lock); | ||
237 | } | ||
238 | |||
239 | static inline void __managed_dentry_clear_automount(struct dentry *dentry) | ||
240 | { | ||
241 | dentry->d_flags &= ~DCACHE_NEED_AUTOMOUNT; | ||
242 | } | ||
243 | |||
244 | static inline void managed_dentry_clear_automount(struct dentry *dentry) | ||
245 | { | ||
246 | spin_lock(&dentry->d_lock); | ||
247 | __managed_dentry_clear_automount(dentry); | ||
248 | spin_unlock(&dentry->d_lock); | ||
249 | } | ||
250 | |||
221 | /* Initializing function */ | 251 | /* Initializing function */ |
222 | 252 | ||
223 | int autofs4_fill_super(struct super_block *, void *, int); | 253 | int autofs4_fill_super(struct super_block *, void *, int); |