diff options
author | Ian Kent <raven@themaw.net> | 2009-01-06 17:42:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:23 -0500 |
commit | a92daf6ba1f9ace8584edc8eb557a77aa7c2c71d (patch) | |
tree | a4734bb761e762af714710ab53c4b3c3c58516f8 /fs/autofs4/inode.c | |
parent | 41cfef2eb87694a8d64105c059b39f7bd6b7d4fe (diff) |
autofs4: make autofs type usage explicit
- the type assigned at mount when no type is given is changed
from 0 to AUTOFS_TYPE_INDIRECT. This was done because 0 and
AUTOFS_TYPE_INDIRECT were being treated implicitly as the same
type.
- previously, an offset mount had it's type set to
AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET but the mount control
re-implementation needs to be able distinguish all three types.
So this was changed to make the type setting explicit.
- a type AUTOFS_TYPE_ANY was added for use by the re-implementation
when checking if a given path is a mountpoint. It's not really a
type as we use this to ask if a given path is a mountpoint in the
autofs_dev_ioctl_ismountpoint() function.
- functions to set and test the autofs mount types have been added to
improve readability and make the type usage explicit.
- the mount type is used from user space for the mount control
re-implementtion so, for consistency, all the definitions have
been moved to the user space include file include/linux/auto_fs4.h.
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r-- | fs/autofs4/inode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index cfc23e53b6f4..716e12b627b2 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -197,9 +197,9 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
197 | seq_printf(m, ",minproto=%d", sbi->min_proto); | 197 | seq_printf(m, ",minproto=%d", sbi->min_proto); |
198 | seq_printf(m, ",maxproto=%d", sbi->max_proto); | 198 | seq_printf(m, ",maxproto=%d", sbi->max_proto); |
199 | 199 | ||
200 | if (sbi->type & AUTOFS_TYPE_OFFSET) | 200 | if (autofs_type_offset(sbi->type)) |
201 | seq_printf(m, ",offset"); | 201 | seq_printf(m, ",offset"); |
202 | else if (sbi->type & AUTOFS_TYPE_DIRECT) | 202 | else if (autofs_type_direct(sbi->type)) |
203 | seq_printf(m, ",direct"); | 203 | seq_printf(m, ",direct"); |
204 | else | 204 | else |
205 | seq_printf(m, ",indirect"); | 205 | seq_printf(m, ",indirect"); |
@@ -284,13 +284,13 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, | |||
284 | *maxproto = option; | 284 | *maxproto = option; |
285 | break; | 285 | break; |
286 | case Opt_indirect: | 286 | case Opt_indirect: |
287 | *type = AUTOFS_TYPE_INDIRECT; | 287 | set_autofs_type_indirect(type); |
288 | break; | 288 | break; |
289 | case Opt_direct: | 289 | case Opt_direct: |
290 | *type = AUTOFS_TYPE_DIRECT; | 290 | set_autofs_type_direct(type); |
291 | break; | 291 | break; |
292 | case Opt_offset: | 292 | case Opt_offset: |
293 | *type = AUTOFS_TYPE_OFFSET; | 293 | set_autofs_type_offset(type); |
294 | break; | 294 | break; |
295 | default: | 295 | default: |
296 | return 1; | 296 | return 1; |
@@ -338,7 +338,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
338 | sbi->sb = s; | 338 | sbi->sb = s; |
339 | sbi->version = 0; | 339 | sbi->version = 0; |
340 | sbi->sub_version = 0; | 340 | sbi->sub_version = 0; |
341 | sbi->type = AUTOFS_TYPE_INDIRECT; | 341 | set_autofs_type_indirect(&sbi->type); |
342 | sbi->min_proto = 0; | 342 | sbi->min_proto = 0; |
343 | sbi->max_proto = 0; | 343 | sbi->max_proto = 0; |
344 | mutex_init(&sbi->wq_mutex); | 344 | mutex_init(&sbi->wq_mutex); |
@@ -380,7 +380,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | root_inode->i_fop = &autofs4_root_operations; | 382 | root_inode->i_fop = &autofs4_root_operations; |
383 | root_inode->i_op = sbi->type & AUTOFS_TYPE_TRIGGER ? | 383 | root_inode->i_op = autofs_type_trigger(sbi->type) ? |
384 | &autofs4_direct_root_inode_operations : | 384 | &autofs4_direct_root_inode_operations : |
385 | &autofs4_indirect_root_inode_operations; | 385 | &autofs4_indirect_root_inode_operations; |
386 | 386 | ||