aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4')
-rw-r--r--fs/autofs4/autofs_i.h6
-rw-r--r--fs/autofs4/expire.c2
-rw-r--r--fs/autofs4/inode.c6
-rw-r--r--fs/autofs4/waitq.c8
4 files changed, 10 insertions, 12 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 69a2f5c92319..ea024d8e37ed 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -21,6 +21,8 @@
21#define AUTOFS_IOC_FIRST AUTOFS_IOC_READY 21#define AUTOFS_IOC_FIRST AUTOFS_IOC_READY
22#define AUTOFS_IOC_COUNT 32 22#define AUTOFS_IOC_COUNT 32
23 23
24#define AUTOFS_TYPE_TRIGGER (AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET)
25
24#include <linux/kernel.h> 26#include <linux/kernel.h>
25#include <linux/slab.h> 27#include <linux/slab.h>
26#include <linux/time.h> 28#include <linux/time.h>
@@ -92,10 +94,6 @@ struct autofs_wait_queue {
92 94
93#define AUTOFS_SBI_MAGIC 0x6d4a556d 95#define AUTOFS_SBI_MAGIC 0x6d4a556d
94 96
95#define AUTOFS_TYPE_INDIRECT 0x0001
96#define AUTOFS_TYPE_DIRECT 0x0002
97#define AUTOFS_TYPE_OFFSET 0x0004
98
99struct autofs_sb_info { 97struct autofs_sb_info {
100 u32 magic; 98 u32 magic;
101 int pipefd; 99 int pipefd;
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index cdabb796ff01..e79dd09e12a1 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -479,7 +479,7 @@ int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
479 if (arg && get_user(do_now, arg)) 479 if (arg && get_user(do_now, arg))
480 return -EFAULT; 480 return -EFAULT;
481 481
482 if (sbi->type & AUTOFS_TYPE_DIRECT) 482 if (sbi->type & AUTOFS_TYPE_TRIGGER)
483 dentry = autofs4_expire_direct(sb, mnt, sbi, do_now); 483 dentry = autofs4_expire_direct(sb, mnt, sbi, do_now);
484 else 484 else
485 dentry = autofs4_expire_indirect(sb, mnt, sbi, do_now); 485 dentry = autofs4_expire_indirect(sb, mnt, sbi, do_now);
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 45d55819203d..7303099fcc1a 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -288,7 +288,7 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
288 *type = AUTOFS_TYPE_DIRECT; 288 *type = AUTOFS_TYPE_DIRECT;
289 break; 289 break;
290 case Opt_offset: 290 case Opt_offset:
291 *type = AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET; 291 *type = AUTOFS_TYPE_OFFSET;
292 break; 292 break;
293 default: 293 default:
294 return 1; 294 return 1;
@@ -336,7 +336,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
336 sbi->sb = s; 336 sbi->sb = s;
337 sbi->version = 0; 337 sbi->version = 0;
338 sbi->sub_version = 0; 338 sbi->sub_version = 0;
339 sbi->type = 0; 339 sbi->type = AUTOFS_TYPE_INDIRECT;
340 sbi->min_proto = 0; 340 sbi->min_proto = 0;
341 sbi->max_proto = 0; 341 sbi->max_proto = 0;
342 mutex_init(&sbi->wq_mutex); 342 mutex_init(&sbi->wq_mutex);
@@ -378,7 +378,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
378 } 378 }
379 379
380 root_inode->i_fop = &autofs4_root_operations; 380 root_inode->i_fop = &autofs4_root_operations;
381 root_inode->i_op = sbi->type & AUTOFS_TYPE_DIRECT ? 381 root_inode->i_op = sbi->type & AUTOFS_TYPE_TRIGGER ?
382 &autofs4_direct_root_inode_operations : 382 &autofs4_direct_root_inode_operations :
383 &autofs4_indirect_root_inode_operations; 383 &autofs4_indirect_root_inode_operations;
384 384
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 35216d18d8b5..6d87bb156326 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -337,7 +337,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
337 * is very similar for indirect mounts except only dentrys 337 * is very similar for indirect mounts except only dentrys
338 * in the root of the autofs file system may be negative. 338 * in the root of the autofs file system may be negative.
339 */ 339 */
340 if (sbi->type & (AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET)) 340 if (sbi->type & AUTOFS_TYPE_TRIGGER)
341 return -ENOENT; 341 return -ENOENT;
342 else if (!IS_ROOT(dentry->d_parent)) 342 else if (!IS_ROOT(dentry->d_parent))
343 return -ENOENT; 343 return -ENOENT;
@@ -348,7 +348,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
348 return -ENOMEM; 348 return -ENOMEM;
349 349
350 /* If this is a direct mount request create a dummy name */ 350 /* If this is a direct mount request create a dummy name */
351 if (IS_ROOT(dentry) && (sbi->type & AUTOFS_TYPE_DIRECT)) 351 if (IS_ROOT(dentry) && sbi->type & AUTOFS_TYPE_TRIGGER)
352 qstr.len = sprintf(name, "%p", dentry); 352 qstr.len = sprintf(name, "%p", dentry);
353 else { 353 else {
354 qstr.len = autofs4_getpath(sbi, dentry, &name); 354 qstr.len = autofs4_getpath(sbi, dentry, &name);
@@ -406,11 +406,11 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
406 type = autofs_ptype_expire_multi; 406 type = autofs_ptype_expire_multi;
407 } else { 407 } else {
408 if (notify == NFY_MOUNT) 408 if (notify == NFY_MOUNT)
409 type = (sbi->type & AUTOFS_TYPE_DIRECT) ? 409 type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
410 autofs_ptype_missing_direct : 410 autofs_ptype_missing_direct :
411 autofs_ptype_missing_indirect; 411 autofs_ptype_missing_indirect;
412 else 412 else
413 type = (sbi->type & AUTOFS_TYPE_DIRECT) ? 413 type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
414 autofs_ptype_expire_direct : 414 autofs_ptype_expire_direct :
415 autofs_ptype_expire_indirect; 415 autofs_ptype_expire_indirect;
416 } 416 }