Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / fs / freevxfs / vxfs_super.c
index 6aa6fbe4f8ee9a5397408d59938140e38fa4c084..647d600f0bc82d7399732e83f8c2f71d5ab625b3 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/vfs.h>
+#include <linux/mount.h>
 
 #include "vxfs.h"
 #include "vxfs_extern.h"
@@ -55,10 +56,10 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
 
 
 static void            vxfs_put_super(struct super_block *);
-static int             vxfs_statfs(struct super_block *, struct kstatfs *);
+static int             vxfs_statfs(struct dentry *, struct kstatfs *);
 static int             vxfs_remount(struct super_block *, int *, char *);
 
-static struct super_operations vxfs_super_ops = {
+static const struct super_operations vxfs_super_ops = {
        .read_inode =           vxfs_read_inode,
        .clear_inode =          vxfs_clear_inode,
        .put_super =            vxfs_put_super,
@@ -90,12 +91,12 @@ vxfs_put_super(struct super_block *sbp)
 
 /**
  * vxfs_statfs - get filesystem information
- * @sbp:       VFS superblock
+ * @dentry:    VFS dentry to locate superblock
  * @bufp:      output buffer
  *
  * Description:
  *   vxfs_statfs fills the statfs buffer @bufp with information
- *   about the filesystem described by @sbp.
+ *   about the filesystem described by @dentry.
  *
  * Returns:
  *   Zero.
@@ -107,12 +108,12 @@ vxfs_put_super(struct super_block *sbp)
  *   This is everything but complete...
  */
 static int
-vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp)
+vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
 {
-       struct vxfs_sb_info             *infp = VXFS_SBI(sbp);
+       struct vxfs_sb_info             *infp = VXFS_SBI(dentry->d_sb);
 
        bufp->f_type = VXFS_SUPER_MAGIC;
-       bufp->f_bsize = sbp->s_blocksize;
+       bufp->f_bsize = dentry->d_sb->s_blocksize;
        bufp->f_blocks = infp->vsi_raw->vs_dsize;
        bufp->f_bfree = infp->vsi_raw->vs_free;
        bufp->f_bavail = 0;
@@ -241,10 +242,11 @@ out:
 /*
  * The usual module blurb.
  */
-static struct super_block *vxfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+static int vxfs_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, vxfs_fill_super);
+       return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super,
+                          mnt);
 }
 
 static struct file_system_type vxfs_fs_type = {
@@ -258,12 +260,17 @@ static struct file_system_type vxfs_fs_type = {
 static int __init
 vxfs_init(void)
 {
+       int rv;
+
        vxfs_inode_cachep = kmem_cache_create("vxfs_inode",
                        sizeof(struct vxfs_inode_info), 0, 
-                       SLAB_RECLAIM_ACCOUNT, NULL, NULL);
-       if (vxfs_inode_cachep)
-               return register_filesystem(&vxfs_fs_type);
-       return -ENOMEM;
+                       SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL, NULL);
+       if (!vxfs_inode_cachep)
+               return -ENOMEM;
+       rv = register_filesystem(&vxfs_fs_type);
+       if (rv < 0)
+               kmem_cache_destroy(vxfs_inode_cachep);
+       return rv;
 }
 
 static void __exit