diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 00:15:43 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 08:42:28 -0800 |
commit | eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc (patch) | |
tree | 70d73e349ab1af57b1975762d9c1170f43de3562 /fs/jfs/inode.c | |
parent | 5451f79f5f817880958ed063864ad268d94ccd1f (diff) | |
download | linux-stable-eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc.tar.gz linux-stable-eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc.tar.bz2 linux-stable-eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc.zip |
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/inode.c')
-rw-r--r-- | fs/jfs/inode.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 4672013802e1..210339784b56 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -31,11 +31,21 @@ #include "jfs_debug.h" -void jfs_read_inode(struct inode *inode) +struct inode *jfs_iget(struct super_block *sb, unsigned long ino) { - if (diRead(inode)) { - make_bad_inode(inode); - return; + struct inode *inode; + int ret; + + inode = iget_locked(sb, ino); + if (!inode) + return ERR_PTR(-ENOMEM); + if (!(inode->i_state & I_NEW)) + return inode; + + ret = diRead(inode); + if (ret < 0) { + iget_failed(inode); + return ERR_PTR(ret); } if (S_ISREG(inode->i_mode)) { @@ -55,6 +65,8 @@ void jfs_read_inode(struct inode *inode) inode->i_op = &jfs_file_inode_operations; init_special_inode(inode, inode->i_mode, inode->i_rdev); } + unlock_new_inode(inode); + return inode; } /* |