aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 03:15:48 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:29 -0500
commitb55c460da6df4e8dfc6f68c00fafe7337b54e2f8 (patch)
treeef38152ff42e3a50a9e193cd66bd81107d58a2e4 /fs/ufs/super.c
parentb8e1343f67460554ca5321956c440cc064e9889b (diff)
iget: stop UFS from using iget() and read_inode()
Stop the UFS filesystem from using iget() and read_inode(). Replace ufs_read_inode() with ufs_iget(), and call that instead of iget(). ufs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ufs_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: Evgeniy Dushistov <dushistov@mail.ru> 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/ufs/super.c')
-rw-r--r--fs/ufs/super.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 0072cb33ebec..73deff475e63 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -633,6 +633,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
633 unsigned block_size, super_block_size; 633 unsigned block_size, super_block_size;
634 unsigned flags; 634 unsigned flags;
635 unsigned super_block_offset; 635 unsigned super_block_offset;
636 int ret = -EINVAL;
636 637
637 uspi = NULL; 638 uspi = NULL;
638 ubh = NULL; 639 ubh = NULL;
@@ -1065,12 +1066,16 @@ magic_found:
1065 uspi->s_maxsymlinklen = 1066 uspi->s_maxsymlinklen =
1066 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen); 1067 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
1067 1068
1068 inode = iget(sb, UFS_ROOTINO); 1069 inode = ufs_iget(sb, UFS_ROOTINO);
1069 if (!inode || is_bad_inode(inode)) 1070 if (IS_ERR(inode)) {
1071 ret = PTR_ERR(inode);
1070 goto failed; 1072 goto failed;
1073 }
1071 sb->s_root = d_alloc_root(inode); 1074 sb->s_root = d_alloc_root(inode);
1072 if (!sb->s_root) 1075 if (!sb->s_root) {
1076 ret = -ENOMEM;
1073 goto dalloc_failed; 1077 goto dalloc_failed;
1078 }
1074 1079
1075 ufs_setup_cstotal(sb); 1080 ufs_setup_cstotal(sb);
1076 /* 1081 /*
@@ -1092,7 +1097,7 @@ failed:
1092 kfree(sbi); 1097 kfree(sbi);
1093 sb->s_fs_info = NULL; 1098 sb->s_fs_info = NULL;
1094 UFSD("EXIT (FAILED)\n"); 1099 UFSD("EXIT (FAILED)\n");
1095 return -EINVAL; 1100 return ret;
1096 1101
1097failed_nomem: 1102failed_nomem:
1098 UFSD("EXIT (NOMEM)\n"); 1103 UFSD("EXIT (NOMEM)\n");
@@ -1326,7 +1331,6 @@ static ssize_t ufs_quota_write(struct super_block *, int, const char *, size_t,
1326static const struct super_operations ufs_super_ops = { 1331static const struct super_operations ufs_super_ops = {
1327 .alloc_inode = ufs_alloc_inode, 1332 .alloc_inode = ufs_alloc_inode,
1328 .destroy_inode = ufs_destroy_inode, 1333 .destroy_inode = ufs_destroy_inode,
1329 .read_inode = ufs_read_inode,
1330 .write_inode = ufs_write_inode, 1334 .write_inode = ufs_write_inode,
1331 .delete_inode = ufs_delete_inode, 1335 .delete_inode = ufs_delete_inode,
1332 .put_super = ufs_put_super, 1336 .put_super = ufs_put_super,