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>
This commit is contained in:
David Howells
2008-02-07 00:15:43 -08:00
committed by Linus Torvalds
parent 5451f79f5f
commit eab1df71a0
4 changed files with 40 additions and 31 deletions

View File

@@ -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;
}
/*