diff options
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 3d283abf67d7..0fffe1c24cec 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/auto_fs4.h> | 16 | #include <linux/auto_fs4.h> |
17 | #include <linux/auto_dev-ioctl.h> | 17 | #include <linux/auto_dev-ioctl.h> |
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | #include <linux/spinlock.h> | ||
19 | #include <linux/list.h> | 20 | #include <linux/list.h> |
20 | 21 | ||
21 | /* This is the range of ioctl() numbers we claim as ours */ | 22 | /* This is the range of ioctl() numbers we claim as ours */ |
@@ -60,6 +61,8 @@ do { \ | |||
60 | current->pid, __func__, ##args); \ | 61 | current->pid, __func__, ##args); \ |
61 | } while (0) | 62 | } while (0) |
62 | 63 | ||
64 | extern spinlock_t autofs4_lock; | ||
65 | |||
63 | /* Unified info structure. This is pointed to by both the dentry and | 66 | /* Unified info structure. This is pointed to by both the dentry and |
64 | inode structures. Each file in the filesystem has an instance of this | 67 | inode structures. Each file in the filesystem has an instance of this |
65 | structure. It holds a reference to the dentry, so dentries are never | 68 | structure. It holds a reference to the dentry, so dentries are never |
@@ -254,17 +257,15 @@ static inline int simple_positive(struct dentry *dentry) | |||
254 | return dentry->d_inode && !d_unhashed(dentry); | 257 | return dentry->d_inode && !d_unhashed(dentry); |
255 | } | 258 | } |
256 | 259 | ||
257 | static inline int __simple_empty(struct dentry *dentry) | 260 | static inline void __autofs4_add_expiring(struct dentry *dentry) |
258 | { | 261 | { |
259 | struct dentry *child; | 262 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); |
260 | int ret = 0; | 263 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
261 | 264 | if (ino) { | |
262 | list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) | 265 | if (list_empty(&ino->expiring)) |
263 | if (simple_positive(child)) | 266 | list_add(&ino->expiring, &sbi->expiring_list); |
264 | goto out; | 267 | } |
265 | ret = 1; | 268 | return; |
266 | out: | ||
267 | return ret; | ||
268 | } | 269 | } |
269 | 270 | ||
270 | static inline void autofs4_add_expiring(struct dentry *dentry) | 271 | static inline void autofs4_add_expiring(struct dentry *dentry) |