diff options
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 385bed09b0d8..57c4903614e5 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * linux/fs/autofs/autofs_i.h | 3 | * linux/fs/autofs/autofs_i.h |
4 | * | 4 | * |
5 | * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved | 5 | * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved |
6 | * Copyright 2005-2006 Ian Kent <raven@themaw.net> | ||
6 | * | 7 | * |
7 | * This file is part of the Linux kernel and is made available under | 8 | * This file is part of the Linux kernel and is made available under |
8 | * the terms of the GNU General Public License, version 2, or at your | 9 | * the terms of the GNU General Public License, version 2, or at your |
@@ -13,6 +14,7 @@ | |||
13 | /* Internal header file for autofs */ | 14 | /* Internal header file for autofs */ |
14 | 15 | ||
15 | #include <linux/auto_fs4.h> | 16 | #include <linux/auto_fs4.h> |
17 | #include <linux/mutex.h> | ||
16 | #include <linux/list.h> | 18 | #include <linux/list.h> |
17 | 19 | ||
18 | /* This is the range of ioctl() numbers we claim as ours */ | 20 | /* This is the range of ioctl() numbers we claim as ours */ |
@@ -40,14 +42,6 @@ | |||
40 | 42 | ||
41 | #define AUTOFS_SUPER_MAGIC 0x0187 | 43 | #define AUTOFS_SUPER_MAGIC 0x0187 |
42 | 44 | ||
43 | /* | ||
44 | * If the daemon returns a negative response (AUTOFS_IOC_FAIL) then the | ||
45 | * kernel will keep the negative response cached for up to the time given | ||
46 | * here, although the time can be shorter if the kernel throws the dcache | ||
47 | * entry away. This probably should be settable from user space. | ||
48 | */ | ||
49 | #define AUTOFS_NEGATIVE_TIMEOUT (60*HZ) /* 1 minute */ | ||
50 | |||
51 | /* Unified info structure. This is pointed to by both the dentry and | 45 | /* Unified info structure. This is pointed to by both the dentry and |
52 | inode structures. Each file in the filesystem has an instance of this | 46 | inode structures. Each file in the filesystem has an instance of this |
53 | structure. It holds a reference to the dentry, so dentries are never | 47 | structure. It holds a reference to the dentry, so dentries are never |
@@ -62,6 +56,7 @@ struct autofs_info { | |||
62 | 56 | ||
63 | struct autofs_sb_info *sbi; | 57 | struct autofs_sb_info *sbi; |
64 | unsigned long last_used; | 58 | unsigned long last_used; |
59 | atomic_t count; | ||
65 | 60 | ||
66 | mode_t mode; | 61 | mode_t mode; |
67 | size_t size; | 62 | size_t size; |
@@ -82,27 +77,41 @@ struct autofs_wait_queue { | |||
82 | int hash; | 77 | int hash; |
83 | int len; | 78 | int len; |
84 | char *name; | 79 | char *name; |
80 | u32 dev; | ||
81 | u64 ino; | ||
82 | uid_t uid; | ||
83 | gid_t gid; | ||
84 | pid_t pid; | ||
85 | pid_t tgid; | ||
85 | /* This is for status reporting upon return */ | 86 | /* This is for status reporting upon return */ |
86 | int status; | 87 | int status; |
87 | atomic_t notified; | 88 | atomic_t notify; |
88 | atomic_t wait_ctr; | 89 | atomic_t wait_ctr; |
89 | }; | 90 | }; |
90 | 91 | ||
91 | #define AUTOFS_SBI_MAGIC 0x6d4a556d | 92 | #define AUTOFS_SBI_MAGIC 0x6d4a556d |
92 | 93 | ||
94 | #define AUTOFS_TYPE_INDIRECT 0x0001 | ||
95 | #define AUTOFS_TYPE_DIRECT 0x0002 | ||
96 | #define AUTOFS_TYPE_OFFSET 0x0004 | ||
97 | |||
93 | struct autofs_sb_info { | 98 | struct autofs_sb_info { |
94 | u32 magic; | 99 | u32 magic; |
95 | struct dentry *root; | 100 | struct dentry *root; |
101 | int pipefd; | ||
96 | struct file *pipe; | 102 | struct file *pipe; |
97 | pid_t oz_pgrp; | 103 | pid_t oz_pgrp; |
98 | int catatonic; | 104 | int catatonic; |
99 | int version; | 105 | int version; |
100 | int sub_version; | 106 | int sub_version; |
107 | int min_proto; | ||
108 | int max_proto; | ||
101 | unsigned long exp_timeout; | 109 | unsigned long exp_timeout; |
110 | unsigned int type; | ||
102 | int reghost_enabled; | 111 | int reghost_enabled; |
103 | int needs_reghost; | 112 | int needs_reghost; |
104 | struct super_block *sb; | 113 | struct super_block *sb; |
105 | struct semaphore wq_sem; | 114 | struct mutex wq_mutex; |
106 | spinlock_t fs_lock; | 115 | spinlock_t fs_lock; |
107 | struct autofs_wait_queue *queues; /* Wait queue pointer */ | 116 | struct autofs_wait_queue *queues; /* Wait queue pointer */ |
108 | }; | 117 | }; |
@@ -165,8 +174,10 @@ int autofs4_expire_multi(struct super_block *, struct vfsmount *, | |||
165 | extern struct inode_operations autofs4_symlink_inode_operations; | 174 | extern struct inode_operations autofs4_symlink_inode_operations; |
166 | extern struct inode_operations autofs4_dir_inode_operations; | 175 | extern struct inode_operations autofs4_dir_inode_operations; |
167 | extern struct inode_operations autofs4_root_inode_operations; | 176 | extern struct inode_operations autofs4_root_inode_operations; |
168 | extern struct file_operations autofs4_dir_operations; | 177 | extern struct inode_operations autofs4_indirect_root_inode_operations; |
169 | extern struct file_operations autofs4_root_operations; | 178 | extern struct inode_operations autofs4_direct_root_inode_operations; |
179 | extern const struct file_operations autofs4_dir_operations; | ||
180 | extern const struct file_operations autofs4_root_operations; | ||
170 | 181 | ||
171 | /* Initializing function */ | 182 | /* Initializing function */ |
172 | 183 | ||
@@ -175,13 +186,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info | |||
175 | 186 | ||
176 | /* Queue management functions */ | 187 | /* Queue management functions */ |
177 | 188 | ||
178 | enum autofs_notify | ||
179 | { | ||
180 | NFY_NONE, | ||
181 | NFY_MOUNT, | ||
182 | NFY_EXPIRE | ||
183 | }; | ||
184 | |||
185 | int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); | 189 | int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); |
186 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); | 190 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); |
187 | void autofs4_catatonic_mode(struct autofs_sb_info *); | 191 | void autofs4_catatonic_mode(struct autofs_sb_info *); |
@@ -199,12 +203,22 @@ static inline int autofs4_follow_mount(struct vfsmount **mnt, struct dentry **de | |||
199 | return res; | 203 | return res; |
200 | } | 204 | } |
201 | 205 | ||
206 | static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) | ||
207 | { | ||
208 | return new_encode_dev(sbi->sb->s_dev); | ||
209 | } | ||
210 | |||
211 | static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi) | ||
212 | { | ||
213 | return sbi->sb->s_root->d_inode->i_ino; | ||
214 | } | ||
215 | |||
202 | static inline int simple_positive(struct dentry *dentry) | 216 | static inline int simple_positive(struct dentry *dentry) |
203 | { | 217 | { |
204 | return dentry->d_inode && !d_unhashed(dentry); | 218 | return dentry->d_inode && !d_unhashed(dentry); |
205 | } | 219 | } |
206 | 220 | ||
207 | static inline int simple_empty_nolock(struct dentry *dentry) | 221 | static inline int __simple_empty(struct dentry *dentry) |
208 | { | 222 | { |
209 | struct dentry *child; | 223 | struct dentry *child; |
210 | int ret = 0; | 224 | int ret = 0; |
@@ -216,3 +230,6 @@ static inline int simple_empty_nolock(struct dentry *dentry) | |||
216 | out: | 230 | out: |
217 | return ret; | 231 | return ret; |
218 | } | 232 | } |
233 | |||
234 | void autofs4_dentry_release(struct dentry *); | ||
235 | |||