diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 03:15:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:27 -0500 |
commit | 210f855963ba5edc4c7150754a79709a7c8a0d3c (patch) | |
tree | 10f5030c3b0eec9e1afe9923d28a99f548f14db4 /fs/affs/inode.c | |
parent | 69840b0d065a031a2e5b3fcc3f30560229e312da (diff) |
iget: stop AFFS from using iget() and read_inode()
Stop the AFFS filesystem from using iget() and read_inode(). Replace
affs_read_inode() with affs_iget(), and call that instead of iget().
affs_iget() then uses iget_locked() directly and returns a proper error code
instead of an inode in the event of an error.
affs_fill_super() returns any error incurred when getting the root inode
instead of EINVAL.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
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/affs/inode.c')
-rw-r--r-- | fs/affs/inode.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 4609a6c13fe..27fe6cbe43a 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c | |||
@@ -15,20 +15,25 @@ | |||
15 | extern const struct inode_operations affs_symlink_inode_operations; | 15 | extern const struct inode_operations affs_symlink_inode_operations; |
16 | extern struct timezone sys_tz; | 16 | extern struct timezone sys_tz; |
17 | 17 | ||
18 | void | 18 | struct inode *affs_iget(struct super_block *sb, unsigned long ino) |
19 | affs_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 | ||
159 | bad_inode: | 165 | bad_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 | ||
165 | int | 171 | int |