aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/autofs_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r--fs/autofs4/autofs_i.h31
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
99struct autofs_wait_queue { 102struct 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
270static 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
283static 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
267void autofs4_dentry_release(struct dentry *); 296void autofs4_dentry_release(struct dentry *);
268extern void autofs4_kill_sb(struct super_block *); 297extern void autofs4_kill_sb(struct super_block *);