aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/inode.c')
-rw-r--r--fs/jfs/inode.c20
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
34void jfs_read_inode(struct inode *inode) 34struct 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/*