]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/autofs_i.h
autofs4: fix direct mount pending expire race
[linux-2.6-omap-h63xx.git] / fs / autofs4 / autofs_i.h
index da8882ff31e610bf87b4d92fd44671432b9e64c6..4b40cbc71e9bc36b5ea4ff6442155d458a4a5cce 100644 (file)
@@ -52,6 +52,8 @@ struct autofs_info {
 
        int             flags;
 
+       struct completion expire_complete;
+
        struct list_head active;
        struct list_head expiring;
 
@@ -69,6 +71,7 @@ struct autofs_info {
 };
 
 #define AUTOFS_INF_EXPIRING    (1<<0) /* dentry is in the process of expiring */
+#define AUTOFS_INF_MOUNTPOINT  (1<<1) /* mountpoint status for direct expire */
 
 struct autofs_wait_queue {
        wait_queue_head_t queue;
@@ -84,7 +87,7 @@ struct autofs_wait_queue {
        pid_t tgid;
        /* This is for status reporting upon return */
        int status;
-       atomic_t wait_ctr;
+       unsigned int wait_ctr;
 };
 
 #define AUTOFS_SBI_MAGIC 0x6d4a556d
@@ -138,18 +141,14 @@ static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) {
 static inline int autofs4_ispending(struct dentry *dentry)
 {
        struct autofs_info *inf = autofs4_dentry_ino(dentry);
-       int pending = 0;
 
        if (dentry->d_flags & DCACHE_AUTOFS_PENDING)
                return 1;
 
-       if (inf) {
-               spin_lock(&inf->sbi->fs_lock);
-               pending = inf->flags & AUTOFS_INF_EXPIRING;
-               spin_unlock(&inf->sbi->fs_lock);
-       }
+       if (inf->flags & AUTOFS_INF_EXPIRING)
+               return 1;
 
-       return pending;
+       return 0;
 }
 
 static inline void autofs4_copy_atime(struct file *src, struct file *dst)