[PATCH] VFS: Permit filesystem to perform statfs with a known root dentry
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / isofs / inode.c
index 1652de1b6cb9e0a57bb9d33f6dff568b3f84196d..3f9c8ba1fa1f95db3c3e622a17cefd5533087eee 100644 (file)
@@ -56,7 +56,7 @@ static void isofs_put_super(struct super_block *sb)
 }
 
 static void isofs_read_inode(struct inode *);
-static int isofs_statfs (struct super_block *, struct kstatfs *);
+static int isofs_statfs (struct dentry *, struct kstatfs *);
 
 static kmem_cache_t *isofs_inode_cachep;
 
@@ -87,7 +87,8 @@ static int init_inodecache(void)
 {
        isofs_inode_cachep = kmem_cache_create("isofs_inode_cache",
                                             sizeof(struct iso_inode_info),
-                                            0, SLAB_RECLAIM_ACCOUNT,
+                                            0, (SLAB_RECLAIM_ACCOUNT|
+                                               SLAB_MEM_SPREAD),
                                             init_once, NULL);
        if (isofs_inode_cachep == NULL)
                return -ENOMEM;
@@ -855,8 +856,7 @@ root_found:
        if (opt.check == 'r') table++;
        s->s_root->d_op = &isofs_dentry_ops[table];
 
-       if (opt.iocharset)
-               kfree(opt.iocharset);
+       kfree(opt.iocharset);
 
        return 0;
 
@@ -895,15 +895,16 @@ out_unknown_format:
 out_freebh:
        brelse(bh);
 out_freesbi:
-       if (opt.iocharset)
-               kfree(opt.iocharset);
+       kfree(opt.iocharset);
        kfree(sbi);
        s->s_fs_info = NULL;
        return -EINVAL;
 }
 
-static int isofs_statfs (struct super_block *sb, struct kstatfs *buf)
+static int isofs_statfs (struct dentry *dentry, struct kstatfs *buf)
 {
+       struct super_block *sb = dentry->d_sb;
+
        buf->f_type = ISOFS_SUPER_MAGIC;
        buf->f_bsize = sb->s_blocksize;
        buf->f_blocks = (ISOFS_SB(sb)->s_nzones
@@ -1164,8 +1165,7 @@ out_nomem:
 
 out_noread:
        printk(KERN_INFO "ISOFS: unable to read i-node block %lu\n", block);
-       if (tmpde)
-               kfree(tmpde);
+       kfree(tmpde);
        return -EIO;
 
 out_toomany:
@@ -1334,8 +1334,7 @@ static void isofs_read_inode(struct inode *inode)
                init_special_inode(inode, inode->i_mode, inode->i_rdev);
 
 out:
-       if (tmpde)
-               kfree(tmpde);
+       kfree(tmpde);
        if (bh)
                brelse(bh);
        return;
@@ -1402,10 +1401,11 @@ struct inode *isofs_iget(struct super_block *sb,
        return inode;
 }
 
-static struct super_block *isofs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+static int isofs_get_sb(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
+       return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super,
+                          mnt);
 }
 
 static struct file_system_type iso9660_fs_type = {