diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 03:15:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:28 -0500 |
commit | eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc (patch) | |
tree | 70d73e349ab1af57b1975762d9c1170f43de3562 /fs/jfs/inode.c | |
parent | 5451f79f5f817880958ed063864ad268d94ccd1f (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/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 @@ | |||
31 | #include "jfs_debug.h" | 31 | #include "jfs_debug.h" |
32 | 32 | ||
33 | 33 | ||
34 | void jfs_read_inode(struct inode *inode) | 34 | struct inode *jfs_iget(struct super_block *sb, unsigned long ino) |
35 | { | 35 | { |
36 | if (diRead(inode)) { | 36 | struct inode *inode; |
37 | make_bad_inode(inode); | 37 | int ret; |
38 | return; | 38 | |
39 | inode = iget_locked(sb, ino); | ||
40 | if (!inode) | ||
41 | return ERR_PTR(-ENOMEM); | ||
42 | if (!(inode->i_state & I_NEW)) | ||
43 | return inode; | ||
44 | |||
45 | ret = diRead(inode); | ||
46 | if (ret < 0) { | ||
47 | iget_failed(inode); | ||
48 | return ERR_PTR(ret); | ||
39 | } | 49 | } |
40 | 50 | ||
41 | if (S_ISREG(inode->i_mode)) { | 51 | if (S_ISREG(inode->i_mode)) { |
@@ -55,6 +65,8 @@ void jfs_read_inode(struct inode *inode) | |||
55 | inode->i_op = &jfs_file_inode_operations; | 65 | inode->i_op = &jfs_file_inode_operations; |
56 | init_special_inode(inode, inode->i_mode, inode->i_rdev); | 66 | init_special_inode(inode, inode->i_mode, inode->i_rdev); |
57 | } | 67 | } |
68 | unlock_new_inode(inode); | ||
69 | return inode; | ||
58 | } | 70 | } |
59 | 71 | ||
60 | /* | 72 | /* |