aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs/inode.c')
-rw-r--r--fs/affs/inode.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 4609a6c13fe9..27fe6cbe43ae 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -15,20 +15,25 @@
15extern const struct inode_operations affs_symlink_inode_operations; 15extern const struct inode_operations affs_symlink_inode_operations;
16extern struct timezone sys_tz; 16extern struct timezone sys_tz;
17 17
18void 18struct inode *affs_iget(struct super_block *sb, unsigned long ino)
19affs_read_inode(struct inode *inode)
20{ 19{
21 struct super_block *sb = inode->i_sb;
22 struct affs_sb_info *sbi = AFFS_SB(sb); 20 struct affs_sb_info *sbi = AFFS_SB(sb);
23 struct buffer_head *bh; 21 struct buffer_head *bh;
24 struct affs_head *head; 22 struct affs_head *head;
25 struct affs_tail *tail; 23 struct affs_tail *tail;
24 struct inode *inode;
26 u32 block; 25 u32 block;
27 u32 size; 26 u32 size;
28 u32 prot; 27 u32 prot;
29 u16 id; 28 u16 id;
30 29
31 pr_debug("AFFS: read_inode(%lu)\n",inode->i_ino); 30 inode = iget_locked(sb, ino);
31 if (!inode)
32 return ERR_PTR(-ENOMEM);
33 if (!(inode->i_state & I_NEW))
34 return inode;
35
36 pr_debug("AFFS: affs_iget(%lu)\n", inode->i_ino);
32 37
33 block = inode->i_ino; 38 block = inode->i_ino;
34 bh = affs_bread(sb, block); 39 bh = affs_bread(sb, block);
@@ -154,12 +159,13 @@ affs_read_inode(struct inode *inode)
154 sys_tz.tz_minuteswest * 60; 159 sys_tz.tz_minuteswest * 60;
155 inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0; 160 inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0;
156 affs_brelse(bh); 161 affs_brelse(bh);
157 return; 162 unlock_new_inode(inode);
163 return inode;
158 164
159bad_inode: 165bad_inode:
160 make_bad_inode(inode);
161 affs_brelse(bh); 166 affs_brelse(bh);
162 return; 167 iget_failed(inode);
168 return ERR_PTR(-EIO);
163} 169}
164 170
165int 171int