summaryrefslogtreecommitdiff
path: root/fs/affs/namei.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-07 11:15:29 +0300
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 19:42:27 +0300
commit210f855963ba5edc4c7150754a79709a7c8a0d3c (patch)
tree10f5030c3b0eec9e1afe9923d28a99f548f14db4 /fs/affs/namei.c
parent69840b0d065a031a2e5b3fcc3f30560229e312da (diff)
downloadlinux-210f855963ba5edc4c7150754a79709a7c8a0d3c.tar.xz
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/namei.c')
-rw-r--r--fs/affs/namei.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index b407e9eea3fb..2218f1ee71ce 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -208,9 +208,8 @@ affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
affs_lock_dir(dir);
bh = affs_find_entry(dir, dentry);
affs_unlock_dir(dir);
- if (IS_ERR(bh)) {
+ if (IS_ERR(bh))
return ERR_CAST(bh);
- }
if (bh) {
u32 ino = bh->b_blocknr;
@@ -223,10 +222,9 @@ affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
ino = be32_to_cpu(AFFS_TAIL(sb, bh)->original);
}
affs_brelse(bh);
- inode = iget(sb, ino);
- if (!inode) {
- return ERR_PTR(-EACCES);
- }
+ inode = affs_iget(sb, ino);
+ if (IS_ERR(inode))
+ return ERR_PTR(PTR_ERR(inode));
}
dentry->d_op = AFFS_SB(sb)->s_flags & SF_INTL ? &affs_intl_dentry_operations : &affs_dentry_operations;
d_add(dentry, inode);