fs: dcache remove d_mounted
[pandora-kernel.git] / fs / autofs4 / expire.c
index 2f7951d..cc1d013 100644 (file)
@@ -295,7 +295,9 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
                struct autofs_info *ino = autofs4_dentry_ino(root);
                if (d_mountpoint(root)) {
                        ino->flags |= AUTOFS_INF_MOUNTPOINT;
-                       root->d_mounted--;
+                       spin_lock(&root->d_lock);
+                       root->d_flags &= ~DCACHE_MOUNTED;
+                       spin_unlock(&root->d_lock);
                }
                ino->flags |= AUTOFS_INF_EXPIRING;
                init_completion(&ino->expire_complete);
@@ -503,7 +505,14 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
 
                spin_lock(&sbi->fs_lock);
                if (ino->flags & AUTOFS_INF_MOUNTPOINT) {
-                       sb->s_root->d_mounted++;
+                       spin_lock(&sb->s_root->d_lock);
+                       /*
+                        * If we haven't been expired away, then reset
+                        * mounted status.
+                        */
+                       if (mnt->mnt_parent != mnt)
+                               sb->s_root->d_flags |= DCACHE_MOUNTED;
+                       spin_unlock(&sb->s_root->d_lock);
                        ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
                }
                ino->flags &= ~AUTOFS_INF_EXPIRING;