]> Pileus Git - ~andy/linux/blobdiff - fs/jfs/super.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[~andy/linux] / fs / jfs / super.c
index 70a14001c98f4c3b13a523346635195fb51cae96..0288e6d7936a200e51b585914cf5ae76847b91a3 100644 (file)
@@ -414,7 +414,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
        struct inode *inode;
        int rc;
        s64 newLVSize = 0;
-       int flag;
+       int flag, ret = -EINVAL;
 
        jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
 
@@ -461,8 +461,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
         * Initialize direct-mapping inode/address-space
         */
        inode = new_inode(sb);
-       if (inode == NULL)
+       if (inode == NULL) {
+               ret = -ENOMEM;
                goto out_kfree;
+       }
        inode->i_ino = 0;
        inode->i_nlink = 1;
        inode->i_size = sb->s_bdev->bd_inode->i_size;
@@ -494,9 +496,11 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 
        sb->s_magic = JFS_SUPER_MAGIC;
 
-       inode = iget(sb, ROOT_I);
-       if (!inode || is_bad_inode(inode))
-               goto out_no_root;
+       inode = jfs_iget(sb, ROOT_I);
+       if (IS_ERR(inode)) {
+               ret = PTR_ERR(inode);
+               goto out_no_rw;
+       }
        sb->s_root = d_alloc_root(inode);
        if (!sb->s_root)
                goto out_no_root;
@@ -517,9 +521,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 
 out_no_root:
-       jfs_err("jfs_read_super: get root inode failed");
-       if (inode)
-               iput(inode);
+       jfs_err("jfs_read_super: get root dentry failed");
+       iput(inode);
 
 out_no_rw:
        rc = jfs_umount(sb);
@@ -536,7 +539,7 @@ out_kfree:
        if (sbi->nls_tab)
                unload_nls(sbi->nls_tab);
        kfree(sbi);
-       return -EINVAL;
+       return ret;
 }
 
 static void jfs_write_super_lockfs(struct super_block *sb)
@@ -726,7 +729,6 @@ out:
 static const struct super_operations jfs_super_operations = {
        .alloc_inode    = jfs_alloc_inode,
        .destroy_inode  = jfs_destroy_inode,
-       .read_inode     = jfs_read_inode,
        .dirty_inode    = jfs_dirty_inode,
        .write_inode    = jfs_write_inode,
        .delete_inode   = jfs_delete_inode,