diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 03:15:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:27 -0500 |
commit | 210f855963ba5edc4c7150754a79709a7c8a0d3c (patch) | |
tree | 10f5030c3b0eec9e1afe9923d28a99f548f14db4 /fs/affs/super.c | |
parent | 69840b0d065a031a2e5b3fcc3f30560229e312da (diff) |
iget: stop AFFS from using iget() and read_inode()
Stop the AFFS filesystem from using iget() and read_inode(). Replace
affs_read_inode() with affs_iget(), and call that instead of iget().
affs_iget() then uses iget_locked() directly and returns a proper error code
instead of an inode in the event of an error.
affs_fill_super() returns any error incurred when getting the root inode
instead of EINVAL.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
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/affs/super.c')
-rw-r--r-- | fs/affs/super.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c index b53e5d0ec65c..3c45d49c0d26 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c | |||
@@ -113,7 +113,6 @@ static void destroy_inodecache(void) | |||
113 | static const struct super_operations affs_sops = { | 113 | static const struct super_operations affs_sops = { |
114 | .alloc_inode = affs_alloc_inode, | 114 | .alloc_inode = affs_alloc_inode, |
115 | .destroy_inode = affs_destroy_inode, | 115 | .destroy_inode = affs_destroy_inode, |
116 | .read_inode = affs_read_inode, | ||
117 | .write_inode = affs_write_inode, | 116 | .write_inode = affs_write_inode, |
118 | .put_inode = affs_put_inode, | 117 | .put_inode = affs_put_inode, |
119 | .drop_inode = affs_drop_inode, | 118 | .drop_inode = affs_drop_inode, |
@@ -271,6 +270,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) | |||
271 | unsigned long mount_flags; | 270 | unsigned long mount_flags; |
272 | int tmp_flags; /* fix remount prototype... */ | 271 | int tmp_flags; /* fix remount prototype... */ |
273 | u8 sig[4]; | 272 | u8 sig[4]; |
273 | int ret = -EINVAL; | ||
274 | 274 | ||
275 | pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); | 275 | pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); |
276 | 276 | ||
@@ -444,7 +444,12 @@ got_root: | |||
444 | 444 | ||
445 | /* set up enough so that it can read an inode */ | 445 | /* set up enough so that it can read an inode */ |
446 | 446 | ||
447 | root_inode = iget(sb, root_block); | 447 | root_inode = affs_iget(sb, root_block); |
448 | if (IS_ERR(root_inode)) { | ||
449 | ret = PTR_ERR(root_inode); | ||
450 | goto out_error_noinode; | ||
451 | } | ||
452 | |||
448 | sb->s_root = d_alloc_root(root_inode); | 453 | sb->s_root = d_alloc_root(root_inode); |
449 | if (!sb->s_root) { | 454 | if (!sb->s_root) { |
450 | printk(KERN_ERR "AFFS: Get root inode failed\n"); | 455 | printk(KERN_ERR "AFFS: Get root inode failed\n"); |
@@ -461,12 +466,13 @@ got_root: | |||
461 | out_error: | 466 | out_error: |
462 | if (root_inode) | 467 | if (root_inode) |
463 | iput(root_inode); | 468 | iput(root_inode); |
469 | out_error_noinode: | ||
464 | kfree(sbi->s_bitmap); | 470 | kfree(sbi->s_bitmap); |
465 | affs_brelse(root_bh); | 471 | affs_brelse(root_bh); |
466 | kfree(sbi->s_prefix); | 472 | kfree(sbi->s_prefix); |
467 | kfree(sbi); | 473 | kfree(sbi); |
468 | sb->s_fs_info = NULL; | 474 | sb->s_fs_info = NULL; |
469 | return -EINVAL; | 475 | return ret; |
470 | } | 476 | } |
471 | 477 | ||
472 | static int | 478 | static int |