Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / autofs4 / inode.c
index fde78b1..5f6190d 100644 (file)
@@ -95,7 +95,7 @@ void autofs4_free_ino(struct autofs_info *ino)
  */
 static void autofs4_force_release(struct autofs_sb_info *sbi)
 {
-       struct dentry *this_parent = sbi->root;
+       struct dentry *this_parent = sbi->sb->s_root;
        struct list_head *next;
 
        spin_lock(&dcache_lock);
@@ -126,7 +126,7 @@ resume:
                spin_lock(&dcache_lock);
        }
 
-       if (this_parent != sbi->root) {
+       if (this_parent != sbi->sb->s_root) {
                struct dentry *dentry = this_parent;
 
                next = this_parent->d_u.d_child.next;
@@ -139,15 +139,9 @@ resume:
                goto resume;
        }
        spin_unlock(&dcache_lock);
-
-       dput(sbi->root);
-       sbi->root = NULL;
-       shrink_dcache_sb(sbi->sb);
-
-       return;
 }
 
-static void autofs4_put_super(struct super_block *sb)
+void autofs4_kill_sb(struct super_block *sb)
 {
        struct autofs_sb_info *sbi = autofs4_sbi(sb);
 
@@ -162,6 +156,7 @@ static void autofs4_put_super(struct super_block *sb)
        kfree(sbi);
 
        DPRINTK("shutting down");
+       kill_anon_super(sb);
 }
 
 static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
@@ -188,7 +183,6 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
 }
 
 static struct super_operations autofs4_sops = {
-       .put_super      = autofs4_put_super,
        .statfs         = simple_statfs,
        .show_options   = autofs4_show_options,
 };
@@ -314,7 +308,6 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 
        s->s_fs_info = sbi;
        sbi->magic = AUTOFS_SBI_MAGIC;
-       sbi->root = NULL;
        sbi->pipefd = -1;
        sbi->catatonic = 0;
        sbi->exp_timeout = 0;
@@ -395,13 +388,6 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        sbi->pipe = pipe;
        sbi->pipefd = pipefd;
 
-       /*
-        * Take a reference to the root dentry so we get a chance to
-        * clean up the dentry tree on umount.
-        * See autofs4_force_release.
-        */
-       sbi->root = dget(root);
-
        /*
         * Success! Install the root dentry now to indicate completion.
         */
@@ -446,7 +432,6 @@ struct inode *autofs4_get_inode(struct super_block *sb,
                inode->i_uid = 0;
                inode->i_gid = 0;
        }
-       inode->i_blksize = PAGE_CACHE_SIZE;
        inode->i_blocks = 0;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;