linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / autofs4 / autofs_i.h
index 94a12ae..385bed0 100644 (file)
@@ -84,6 +84,7 @@ struct autofs_wait_queue {
        char *name;
        /* This is for status reporting upon return */
        int status;
+       atomic_t notified;
        atomic_t wait_ctr;
 };
 
@@ -91,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;
@@ -101,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 */
 };
 
@@ -126,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)
@@ -138,7 +150,6 @@ static inline void autofs4_copy_atime(struct file *src, struct file *dst)
 }
 
 struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *);
-struct autofs_info *autofs4_init_inf(struct autofs_sb_info *, mode_t mode);
 void autofs4_free_ino(struct autofs_info *);
 
 /* Expiration */
@@ -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);
@@ -185,7 +209,7 @@ static inline int simple_empty_nolock(struct dentry *dentry)
        struct dentry *child;
        int ret = 0;
 
-       list_for_each_entry(child, &dentry->d_subdirs, d_child)
+       list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child)
                if (simple_positive(child))
                        goto out;
        ret = 1;