1 Index: linux-2.6.27/fs/autofs4/autofs_i.h
2 ===================================================================
3 --- linux-2.6.27.orig/fs/autofs4/autofs_i.h
4 +++ linux-2.6.27/fs/autofs4/autofs_i.h
6 #define AUTOFS_IOC_FIRST AUTOFS_IOC_READY
7 #define AUTOFS_IOC_COUNT 32
9 +#define AUTOFS_TYPE_TRIGGER (AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET)
11 #include <linux/kernel.h>
12 #include <linux/slab.h>
13 #include <linux/time.h>
14 @@ -92,10 +94,6 @@ struct autofs_wait_queue {
16 #define AUTOFS_SBI_MAGIC 0x6d4a556d
18 -#define AUTOFS_TYPE_INDIRECT 0x0001
19 -#define AUTOFS_TYPE_DIRECT 0x0002
20 -#define AUTOFS_TYPE_OFFSET 0x0004
22 struct autofs_sb_info {
25 Index: linux-2.6.27/fs/autofs4/expire.c
26 ===================================================================
27 --- linux-2.6.27.orig/fs/autofs4/expire.c
28 +++ linux-2.6.27/fs/autofs4/expire.c
29 @@ -56,12 +56,23 @@ static int autofs4_mount_busy(struct vfs
33 - if (!autofs4_follow_mount(&mnt, &dentry))
34 + if (!follow_down(&mnt, &dentry))
37 - /* This is an autofs submount, we can't expire it */
38 - if (is_autofs4_dentry(dentry))
40 + if (is_autofs4_dentry(dentry)) {
41 + struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
43 + /* This is an autofs submount, we can't expire it */
44 + if (sbi->type == AUTOFS_TYPE_INDIRECT)
48 + * Otherwise it's an offset mount and we need to check
49 + * if we can umount its mount, if there is one.
51 + if (!d_mountpoint(dentry))
55 /* Update the expiry counter if fs is busy */
56 if (!may_umount_tree(mnt)) {
57 @@ -479,7 +490,7 @@ int autofs4_expire_multi(struct super_bl
58 if (arg && get_user(do_now, arg))
61 - if (sbi->type & AUTOFS_TYPE_DIRECT)
62 + if (sbi->type & AUTOFS_TYPE_TRIGGER)
63 dentry = autofs4_expire_direct(sb, mnt, sbi, do_now);
65 dentry = autofs4_expire_indirect(sb, mnt, sbi, do_now);
66 Index: linux-2.6.27/fs/autofs4/inode.c
67 ===================================================================
68 --- linux-2.6.27.orig/fs/autofs4/inode.c
69 +++ linux-2.6.27/fs/autofs4/inode.c
70 @@ -288,7 +288,7 @@ static int parse_options(char *options,
71 *type = AUTOFS_TYPE_DIRECT;
74 - *type = AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET;
75 + *type = AUTOFS_TYPE_OFFSET;
79 @@ -336,7 +336,7 @@ int autofs4_fill_super(struct super_bloc
84 + sbi->type = AUTOFS_TYPE_INDIRECT;
87 mutex_init(&sbi->wq_mutex);
88 @@ -378,7 +378,7 @@ int autofs4_fill_super(struct super_bloc
91 root_inode->i_fop = &autofs4_root_operations;
92 - root_inode->i_op = sbi->type & AUTOFS_TYPE_DIRECT ?
93 + root_inode->i_op = sbi->type & AUTOFS_TYPE_TRIGGER ?
94 &autofs4_direct_root_inode_operations :
95 &autofs4_indirect_root_inode_operations;
97 Index: linux-2.6.27/fs/autofs4/waitq.c
98 ===================================================================
99 --- linux-2.6.27.orig/fs/autofs4/waitq.c
100 +++ linux-2.6.27/fs/autofs4/waitq.c
101 @@ -337,7 +337,7 @@ int autofs4_wait(struct autofs_sb_info *
102 * is very similar for indirect mounts except only dentrys
103 * in the root of the autofs file system may be negative.
105 - if (sbi->type & (AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET))
106 + if (sbi->type & AUTOFS_TYPE_TRIGGER)
108 else if (!IS_ROOT(dentry->d_parent))
110 @@ -348,7 +348,7 @@ int autofs4_wait(struct autofs_sb_info *
113 /* If this is a direct mount request create a dummy name */
114 - if (IS_ROOT(dentry) && (sbi->type & AUTOFS_TYPE_DIRECT))
115 + if (IS_ROOT(dentry) && sbi->type & AUTOFS_TYPE_TRIGGER)
116 qstr.len = sprintf(name, "%p", dentry);
118 qstr.len = autofs4_getpath(sbi, dentry, &name);
119 @@ -406,11 +406,11 @@ int autofs4_wait(struct autofs_sb_info *
120 type = autofs_ptype_expire_multi;
122 if (notify == NFY_MOUNT)
123 - type = (sbi->type & AUTOFS_TYPE_DIRECT) ?
124 + type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
125 autofs_ptype_missing_direct :
126 autofs_ptype_missing_indirect;
128 - type = (sbi->type & AUTOFS_TYPE_DIRECT) ?
129 + type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
130 autofs_ptype_expire_direct :
131 autofs_ptype_expire_indirect;
133 Index: linux-2.6.27/include/linux/auto_fs4.h
134 ===================================================================
135 --- linux-2.6.27.orig/include/linux/auto_fs4.h
136 +++ linux-2.6.27/include/linux/auto_fs4.h
138 #define AUTOFS_EXP_IMMEDIATE 1
139 #define AUTOFS_EXP_LEAVES 2
141 +#define AUTOFS_TYPE_ANY 0x0000
142 +#define AUTOFS_TYPE_INDIRECT 0x0001
143 +#define AUTOFS_TYPE_DIRECT 0x0002
144 +#define AUTOFS_TYPE_OFFSET 0x0004
146 /* Daemon notification packet types */