summaryrefslogtreecommitdiffstats
path: root/fs/efs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 00:15:34 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 08:42:27 -0800
commit298384cd7929a3a14d7b116095973f0d02f5d09e (patch)
tree651ef96b214831a77e12b120d8eb5262a9d49d74 /fs/efs/super.c
parentce634ab28e7dbcc13ebe6e7bc5bc7de4f8def4c8 (diff)
downloadop-kernel-dev-298384cd7929a3a14d7b116095973f0d02f5d09e.zip
op-kernel-dev-298384cd7929a3a14d7b116095973f0d02f5d09e.tar.gz
iget: stop EFS from using iget() and read_inode()
Stop the EFS filesystem from using iget() and read_inode(). Replace efs_read_inode() with efs_iget(), and call that instead of iget(). efs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. efs_fill_super() returns any error incurred when getting the root inode instead of EACCES. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/efs/super.c')
-rw-r--r--fs/efs/super.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/efs/super.c b/fs/efs/super.c
index c79bc62..1408240 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -107,7 +107,6 @@ 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,
@@ -247,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)
@@ -303,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;
}
@@ -318,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) {
OpenPOWER on IntegriCloud