aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 03:15:43 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:28 -0500
commiteab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc (patch)
tree70d73e349ab1af57b1975762d9c1170f43de3562 /fs/jfs/super.c
parent5451f79f5f817880958ed063864ad268d94ccd1f (diff)
iget: stop JFS from using iget() and read_inode()
Stop the JFS filesystem from using iget() and read_inode(). Replace jfs_read_inode() with jfs_iget(), and call that instead of iget(). jfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. jfs_fill_super() returns any error incurred when getting the root inode instead of EINVAL. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.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/jfs/super.c')
-rw-r--r--fs/jfs/super.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 70a14001c98f..50ea65451732 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -414,7 +414,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
414 struct inode *inode; 414 struct inode *inode;
415 int rc; 415 int rc;
416 s64 newLVSize = 0; 416 s64 newLVSize = 0;
417 int flag; 417 int flag, ret = -EINVAL;
418 418
419 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); 419 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
420 420
@@ -461,8 +461,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
461 * Initialize direct-mapping inode/address-space 461 * Initialize direct-mapping inode/address-space
462 */ 462 */
463 inode = new_inode(sb); 463 inode = new_inode(sb);
464 if (inode == NULL) 464 if (inode == NULL) {
465 ret = -ENOMEM;
465 goto out_kfree; 466 goto out_kfree;
467 }
466 inode->i_ino = 0; 468 inode->i_ino = 0;
467 inode->i_nlink = 1; 469 inode->i_nlink = 1;
468 inode->i_size = sb->s_bdev->bd_inode->i_size; 470 inode->i_size = sb->s_bdev->bd_inode->i_size;
@@ -494,9 +496,11 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
494 496
495 sb->s_magic = JFS_SUPER_MAGIC; 497 sb->s_magic = JFS_SUPER_MAGIC;
496 498
497 inode = iget(sb, ROOT_I); 499 inode = jfs_iget(sb, ROOT_I);
498 if (!inode || is_bad_inode(inode)) 500 if (IS_ERR(inode)) {
501 ret = PTR_ERR(inode);
499 goto out_no_root; 502 goto out_no_root;
503 }
500 sb->s_root = d_alloc_root(inode); 504 sb->s_root = d_alloc_root(inode);
501 if (!sb->s_root) 505 if (!sb->s_root)
502 goto out_no_root; 506 goto out_no_root;
@@ -536,7 +540,7 @@ out_kfree:
536 if (sbi->nls_tab) 540 if (sbi->nls_tab)
537 unload_nls(sbi->nls_tab); 541 unload_nls(sbi->nls_tab);
538 kfree(sbi); 542 kfree(sbi);
539 return -EINVAL; 543 return ret;
540} 544}
541 545
542static void jfs_write_super_lockfs(struct super_block *sb) 546static void jfs_write_super_lockfs(struct super_block *sb)
@@ -726,7 +730,6 @@ out:
726static const struct super_operations jfs_super_operations = { 730static const struct super_operations jfs_super_operations = {
727 .alloc_inode = jfs_alloc_inode, 731 .alloc_inode = jfs_alloc_inode,
728 .destroy_inode = jfs_destroy_inode, 732 .destroy_inode = jfs_destroy_inode,
729 .read_inode = jfs_read_inode,
730 .dirty_inode = jfs_dirty_inode, 733 .dirty_inode = jfs_dirty_inode,
731 .write_inode = jfs_write_inode, 734 .write_inode = jfs_write_inode,
732 .delete_inode = jfs_delete_inode, 735 .delete_inode = jfs_delete_inode,