]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/efs/super.c
iget: stop EFS from using iget() and read_inode()
[linux-2.6-omap-h63xx.git] / fs / efs / super.c
index e0a6839e68ae0f53f762a5f4aed8466b6d1d98ff..14082405cdd16b7eb7fdde3367a4e339c36b37ce 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/efs_fs.h>
 #include <linux/efs_vh.h>
 #include <linux/efs_fs_sb.h>
+#include <linux/exportfs.h>
 #include <linux/slab.h>
 #include <linux/buffer_head.h>
 #include <linux/vfs.h>
@@ -68,19 +69,19 @@ static void efs_destroy_inode(struct inode *inode)
        kmem_cache_free(efs_inode_cachep, INODE_INFO(inode));
 }
 
-static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
+static void init_once(struct kmem_cache *cachep, void *foo)
 {
        struct efs_inode_info *ei = (struct efs_inode_info *) foo;
 
        inode_init_once(&ei->vfs_inode);
 }
+
 static int init_inodecache(void)
 {
        efs_inode_cachep = kmem_cache_create("efs_inode_cache",
                                sizeof(struct efs_inode_info),
                                0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
-                               init_once, NULL);
+                               init_once);
        if (efs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;
@@ -106,13 +107,14 @@ static int efs_remount(struct super_block *sb, int *flags, char *data)
 static const struct super_operations efs_superblock_operations = {
        .alloc_inode    = efs_alloc_inode,
        .destroy_inode  = efs_destroy_inode,
-       .read_inode     = efs_read_inode,
        .put_super      = efs_put_super,
        .statfs         = efs_statfs,
        .remount_fs     = efs_remount,
 };
 
-static struct export_operations efs_export_ops = {
+static const struct export_operations efs_export_ops = {
+       .fh_to_dentry   = efs_fh_to_dentry,
+       .fh_to_parent   = efs_fh_to_parent,
        .get_parent     = efs_get_parent,
 };
 
@@ -244,6 +246,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
        struct efs_sb_info *sb;
        struct buffer_head *bh;
        struct inode *root;
+       int ret = -EINVAL;
 
        sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
        if (!sb)
@@ -300,12 +303,18 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
        }
        s->s_op   = &efs_superblock_operations;
        s->s_export_op = &efs_export_ops;
-       root = iget(s, EFS_ROOTINODE);
+       root = efs_iget(s, EFS_ROOTINODE);
+       if (IS_ERR(root)) {
+               printk(KERN_ERR "EFS: get root inode failed\n");
+               ret = PTR_ERR(root);
+               goto out_no_fs;
+       }
+
        s->s_root = d_alloc_root(root);
        if (!(s->s_root)) {
-               printk(KERN_ERR "EFS: get root inode failed\n");
+               printk(KERN_ERR "EFS: get root dentry failed\n");
                iput(root);
+               ret = -ENOMEM;
                goto out_no_fs;
        }
 
@@ -315,7 +324,7 @@ out_no_fs_ul:
 out_no_fs:
        s->s_fs_info = NULL;
        kfree(sb);
-       return -EINVAL;
+       return ret;
 }
 
 static int efs_statfs(struct dentry *dentry, struct kstatfs *buf) {