]> err.no Git - linux-2.6/blobdiff - fs/autofs4/autofs_i.h
Pull prarit-bus-sysdata into release branch
[linux-2.6] / fs / autofs4 / autofs_i.h
index 9789877352522440d723186002c32d8ddc6d5d20..fca83e28edcf678cb8de5bb6838c7ec654c2455f 100644 (file)
@@ -92,6 +92,7 @@ struct autofs_wait_queue {
 
 struct autofs_sb_info {
        u32 magic;
+       struct dentry *root;
        struct file *pipe;
        pid_t oz_pgrp;
        int catatonic;
@@ -102,6 +103,7 @@ struct autofs_sb_info {
        int needs_reghost;
        struct super_block *sb;
        struct semaphore wq_sem;
+       spinlock_t fs_lock;
        struct autofs_wait_queue *queues; /* Wait queue pointer */
 };
 
@@ -127,9 +129,18 @@ 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;
 
-       return (dentry->d_flags & DCACHE_AUTOFS_PENDING) ||
-               (inf != NULL && inf->flags & AUTOFS_INF_EXPIRING);
+       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);
+       }
+
+       return pending;
 }
 
 static inline void autofs4_copy_atime(struct file *src, struct file *dst)
@@ -175,6 +186,19 @@ int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
 int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
 void autofs4_catatonic_mode(struct autofs_sb_info *);
 
+static inline int autofs4_follow_mount(struct vfsmount **mnt, struct dentry **dentry)
+{
+       int res = 0;
+
+       while (d_mountpoint(*dentry)) {
+               int followed = follow_down(mnt, dentry);
+               if (!followed)
+                       break;
+               res = 1;
+       }
+       return res;
+}
+
 static inline int simple_positive(struct dentry *dentry)
 {
        return dentry->d_inode && !d_unhashed(dentry);