diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /fs/autofs4/autofs_i.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 8f7cdde41733..3d283abf67d7 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -75,6 +75,8 @@ struct autofs_info { | |||
75 | struct completion expire_complete; | 75 | struct completion expire_complete; |
76 | 76 | ||
77 | struct list_head active; | 77 | struct list_head active; |
78 | int active_count; | ||
79 | |||
78 | struct list_head expiring; | 80 | struct list_head expiring; |
79 | 81 | ||
80 | struct autofs_sb_info *sbi; | 82 | struct autofs_sb_info *sbi; |
@@ -95,6 +97,7 @@ struct autofs_info { | |||
95 | 97 | ||
96 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ | 98 | #define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ |
97 | #define AUTOFS_INF_MOUNTPOINT (1<<1) /* mountpoint status for direct expire */ | 99 | #define AUTOFS_INF_MOUNTPOINT (1<<1) /* mountpoint status for direct expire */ |
100 | #define AUTOFS_INF_PENDING (1<<2) /* dentry pending mount */ | ||
98 | 101 | ||
99 | struct autofs_wait_queue { | 102 | struct autofs_wait_queue { |
100 | wait_queue_head_t queue; | 103 | wait_queue_head_t queue; |
@@ -161,7 +164,7 @@ static inline int autofs4_ispending(struct dentry *dentry) | |||
161 | { | 164 | { |
162 | struct autofs_info *inf = autofs4_dentry_ino(dentry); | 165 | struct autofs_info *inf = autofs4_dentry_ino(dentry); |
163 | 166 | ||
164 | if (dentry->d_flags & DCACHE_AUTOFS_PENDING) | 167 | if (inf->flags & AUTOFS_INF_PENDING) |
165 | return 1; | 168 | return 1; |
166 | 169 | ||
167 | if (inf->flags & AUTOFS_INF_EXPIRING) | 170 | if (inf->flags & AUTOFS_INF_EXPIRING) |
@@ -264,5 +267,31 @@ out: | |||
264 | return ret; | 267 | return ret; |
265 | } | 268 | } |
266 | 269 | ||
270 | static inline void autofs4_add_expiring(struct dentry *dentry) | ||
271 | { | ||
272 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); | ||
273 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | ||
274 | if (ino) { | ||
275 | spin_lock(&sbi->lookup_lock); | ||
276 | if (list_empty(&ino->expiring)) | ||
277 | list_add(&ino->expiring, &sbi->expiring_list); | ||
278 | spin_unlock(&sbi->lookup_lock); | ||
279 | } | ||
280 | return; | ||
281 | } | ||
282 | |||
283 | static inline void autofs4_del_expiring(struct dentry *dentry) | ||
284 | { | ||
285 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); | ||
286 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | ||
287 | if (ino) { | ||
288 | spin_lock(&sbi->lookup_lock); | ||
289 | if (!list_empty(&ino->expiring)) | ||
290 | list_del_init(&ino->expiring); | ||
291 | spin_unlock(&sbi->lookup_lock); | ||
292 | } | ||
293 | return; | ||
294 | } | ||
295 | |||
267 | void autofs4_dentry_release(struct dentry *); | 296 | void autofs4_dentry_release(struct dentry *); |
268 | extern void autofs4_kill_sb(struct super_block *); | 297 | extern void autofs4_kill_sb(struct super_block *); |