diff options
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 113 |
1 files changed, 78 insertions, 35 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 0fffe1c24cec..54f923792728 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -88,18 +88,9 @@ struct autofs_info { | |||
88 | 88 | ||
89 | uid_t uid; | 89 | uid_t uid; |
90 | gid_t gid; | 90 | gid_t gid; |
91 | |||
92 | mode_t mode; | ||
93 | size_t size; | ||
94 | |||
95 | void (*free)(struct autofs_info *); | ||
96 | union { | ||
97 | const char *symlink; | ||
98 | } u; | ||
99 | }; | 91 | }; |
100 | 92 | ||
101 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ | 93 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ |
102 | #define AUTOFS_INF_MOUNTPOINT (1<<1) /* mountpoint status for direct expire */ | ||
103 | #define AUTOFS_INF_PENDING (1<<2) /* dentry pending mount */ | 94 | #define AUTOFS_INF_PENDING (1<<2) /* dentry pending mount */ |
104 | 95 | ||
105 | struct autofs_wait_queue { | 96 | struct autofs_wait_queue { |
@@ -176,14 +167,7 @@ static inline int autofs4_ispending(struct dentry *dentry) | |||
176 | return 0; | 167 | return 0; |
177 | } | 168 | } |
178 | 169 | ||
179 | static inline void autofs4_copy_atime(struct file *src, struct file *dst) | 170 | struct inode *autofs4_get_inode(struct super_block *, mode_t); |
180 | { | ||
181 | dst->f_path.dentry->d_inode->i_atime = | ||
182 | src->f_path.dentry->d_inode->i_atime; | ||
183 | return; | ||
184 | } | ||
185 | |||
186 | struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *); | ||
187 | void autofs4_free_ino(struct autofs_info *); | 171 | void autofs4_free_ino(struct autofs_info *); |
188 | 172 | ||
189 | /* Expiration */ | 173 | /* Expiration */ |
@@ -212,16 +196,89 @@ void autofs_dev_ioctl_exit(void); | |||
212 | 196 | ||
213 | extern const struct inode_operations autofs4_symlink_inode_operations; | 197 | extern const struct inode_operations autofs4_symlink_inode_operations; |
214 | extern const struct inode_operations autofs4_dir_inode_operations; | 198 | extern const struct inode_operations autofs4_dir_inode_operations; |
215 | extern const struct inode_operations autofs4_root_inode_operations; | ||
216 | extern const struct inode_operations autofs4_indirect_root_inode_operations; | ||
217 | extern const struct inode_operations autofs4_direct_root_inode_operations; | ||
218 | extern const struct file_operations autofs4_dir_operations; | 199 | extern const struct file_operations autofs4_dir_operations; |
219 | extern const struct file_operations autofs4_root_operations; | 200 | extern const struct file_operations autofs4_root_operations; |
201 | extern const struct dentry_operations autofs4_dentry_operations; | ||
202 | |||
203 | /* VFS automount flags management functions */ | ||
204 | |||
205 | static inline void __managed_dentry_set_automount(struct dentry *dentry) | ||
206 | { | ||
207 | dentry->d_flags |= DCACHE_NEED_AUTOMOUNT; | ||
208 | } | ||
209 | |||
210 | static inline void managed_dentry_set_automount(struct dentry *dentry) | ||
211 | { | ||
212 | spin_lock(&dentry->d_lock); | ||
213 | __managed_dentry_set_automount(dentry); | ||
214 | spin_unlock(&dentry->d_lock); | ||
215 | } | ||
216 | |||
217 | static inline void __managed_dentry_clear_automount(struct dentry *dentry) | ||
218 | { | ||
219 | dentry->d_flags &= ~DCACHE_NEED_AUTOMOUNT; | ||
220 | } | ||
221 | |||
222 | static inline void managed_dentry_clear_automount(struct dentry *dentry) | ||
223 | { | ||
224 | spin_lock(&dentry->d_lock); | ||
225 | __managed_dentry_clear_automount(dentry); | ||
226 | spin_unlock(&dentry->d_lock); | ||
227 | } | ||
228 | |||
229 | static inline void __managed_dentry_set_transit(struct dentry *dentry) | ||
230 | { | ||
231 | dentry->d_flags |= DCACHE_MANAGE_TRANSIT; | ||
232 | } | ||
233 | |||
234 | static inline void managed_dentry_set_transit(struct dentry *dentry) | ||
235 | { | ||
236 | spin_lock(&dentry->d_lock); | ||
237 | __managed_dentry_set_transit(dentry); | ||
238 | spin_unlock(&dentry->d_lock); | ||
239 | } | ||
240 | |||
241 | static inline void __managed_dentry_clear_transit(struct dentry *dentry) | ||
242 | { | ||
243 | dentry->d_flags &= ~DCACHE_MANAGE_TRANSIT; | ||
244 | } | ||
245 | |||
246 | static inline void managed_dentry_clear_transit(struct dentry *dentry) | ||
247 | { | ||
248 | spin_lock(&dentry->d_lock); | ||
249 | __managed_dentry_clear_transit(dentry); | ||
250 | spin_unlock(&dentry->d_lock); | ||
251 | } | ||
252 | |||
253 | static inline void __managed_dentry_set_managed(struct dentry *dentry) | ||
254 | { | ||
255 | dentry->d_flags |= (DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT); | ||
256 | } | ||
257 | |||
258 | static inline void managed_dentry_set_managed(struct dentry *dentry) | ||
259 | { | ||
260 | spin_lock(&dentry->d_lock); | ||
261 | __managed_dentry_set_managed(dentry); | ||
262 | spin_unlock(&dentry->d_lock); | ||
263 | } | ||
264 | |||
265 | static inline void __managed_dentry_clear_managed(struct dentry *dentry) | ||
266 | { | ||
267 | dentry->d_flags &= ~(DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT); | ||
268 | } | ||
269 | |||
270 | static inline void managed_dentry_clear_managed(struct dentry *dentry) | ||
271 | { | ||
272 | spin_lock(&dentry->d_lock); | ||
273 | __managed_dentry_clear_managed(dentry); | ||
274 | spin_unlock(&dentry->d_lock); | ||
275 | } | ||
220 | 276 | ||
221 | /* Initializing function */ | 277 | /* Initializing function */ |
222 | 278 | ||
223 | int autofs4_fill_super(struct super_block *, void *, int); | 279 | int autofs4_fill_super(struct super_block *, void *, int); |
224 | struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi, mode_t mode); | 280 | struct autofs_info *autofs4_new_ino(struct autofs_sb_info *); |
281 | void autofs4_clean_ino(struct autofs_info *); | ||
225 | 282 | ||
226 | /* Queue management functions */ | 283 | /* Queue management functions */ |
227 | 284 | ||
@@ -229,19 +286,6 @@ int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); | |||
229 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); | 286 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); |
230 | void autofs4_catatonic_mode(struct autofs_sb_info *); | 287 | void autofs4_catatonic_mode(struct autofs_sb_info *); |
231 | 288 | ||
232 | static inline int autofs4_follow_mount(struct path *path) | ||
233 | { | ||
234 | int res = 0; | ||
235 | |||
236 | while (d_mountpoint(path->dentry)) { | ||
237 | int followed = follow_down(path); | ||
238 | if (!followed) | ||
239 | break; | ||
240 | res = 1; | ||
241 | } | ||
242 | return res; | ||
243 | } | ||
244 | |||
245 | static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) | 289 | static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) |
246 | { | 290 | { |
247 | return new_encode_dev(sbi->sb->s_dev); | 291 | return new_encode_dev(sbi->sb->s_dev); |
@@ -294,5 +338,4 @@ static inline void autofs4_del_expiring(struct dentry *dentry) | |||
294 | return; | 338 | return; |
295 | } | 339 | } |
296 | 340 | ||
297 | void autofs4_dentry_release(struct dentry *); | ||
298 | extern void autofs4_kill_sb(struct super_block *); | 341 | extern void autofs4_kill_sb(struct super_block *); |