aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/namei.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 03:15:36 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:27 -0500
commit473043dcee1874aab99f66b0362b344618eb3790 (patch)
treebc329501ec6cd0d31dfe11d4587347093dca4ccf /fs/ext3/namei.c
parent52fcf7032935b33158e3998ed399cac97447ab8d (diff)
iget: stop EXT3 from using iget() and read_inode()
Stop the EXT3 filesystem from using iget() and read_inode(). Replace ext3_read_inode() with ext3_iget(), and call that instead of iget(). ext3_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ext3_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> Acked-by: "Theodore Ts'o" <tytso@mit.edu> Acked-by: Jan Kara <jack@suse.cz> Cc: <linux-ext4@vger.kernel.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/ext3/namei.c')
-rw-r--r--fs/ext3/namei.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 92b83b004dd8..dec3e0d88ab1 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1037,17 +1037,11 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str
1037 if (!ext3_valid_inum(dir->i_sb, ino)) { 1037 if (!ext3_valid_inum(dir->i_sb, ino)) {
1038 ext3_error(dir->i_sb, "ext3_lookup", 1038 ext3_error(dir->i_sb, "ext3_lookup",
1039 "bad inode number: %lu", ino); 1039 "bad inode number: %lu", ino);
1040 inode = NULL; 1040 return ERR_PTR(-EIO);
1041 } else
1042 inode = iget(dir->i_sb, ino);
1043
1044 if (!inode)
1045 return ERR_PTR(-EACCES);
1046
1047 if (is_bad_inode(inode)) {
1048 iput(inode);
1049 return ERR_PTR(-ENOENT);
1050 } 1041 }
1042 inode = ext3_iget(dir->i_sb, ino);
1043 if (IS_ERR(inode))
1044 return ERR_CAST(inode);
1051 } 1045 }
1052 return d_splice_alias(inode, dentry); 1046 return d_splice_alias(inode, dentry);
1053} 1047}
@@ -1076,18 +1070,13 @@ struct dentry *ext3_get_parent(struct dentry *child)
1076 if (!ext3_valid_inum(child->d_inode->i_sb, ino)) { 1070 if (!ext3_valid_inum(child->d_inode->i_sb, ino)) {
1077 ext3_error(child->d_inode->i_sb, "ext3_get_parent", 1071 ext3_error(child->d_inode->i_sb, "ext3_get_parent",
1078 "bad inode number: %lu", ino); 1072 "bad inode number: %lu", ino);
1079 inode = NULL; 1073 return ERR_PTR(-EIO);
1080 } else
1081 inode = iget(child->d_inode->i_sb, ino);
1082
1083 if (!inode)
1084 return ERR_PTR(-EACCES);
1085
1086 if (is_bad_inode(inode)) {
1087 iput(inode);
1088 return ERR_PTR(-ENOENT);
1089 } 1074 }
1090 1075
1076 inode = ext3_iget(child->d_inode->i_sb, ino);
1077 if (IS_ERR(inode))
1078 return ERR_CAST(inode);
1079
1091 parent = d_alloc_anon(inode); 1080 parent = d_alloc_anon(inode);
1092 if (!parent) { 1081 if (!parent) {
1093 iput(inode); 1082 iput(inode);