diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 03:15:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:27 -0500 |
commit | 298384cd7929a3a14d7b116095973f0d02f5d09e (patch) | |
tree | 651ef96b214831a77e12b120d8eb5262a9d49d74 /fs/efs/inode.c | |
parent | ce634ab28e7dbcc13ebe6e7bc5bc7de4f8def4c8 (diff) |
iget: stop EFS from using iget() and read_inode()
Stop the EFS filesystem from using iget() and read_inode(). Replace
efs_read_inode() with efs_iget(), and call that instead of iget(). efs_iget()
then uses iget_locked() directly and returns a proper error code instead of an
inode in the event of an error.
efs_fill_super() returns any error incurred when getting the root inode
instead of EACCES.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: David Howells <dhowells@redhat.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/efs/inode.c')
-rw-r--r-- | fs/efs/inode.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 174696f9bf14..627c3026946d 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c | |||
@@ -45,17 +45,26 @@ static inline void extent_copy(efs_extent *src, efs_extent *dst) { | |||
45 | return; | 45 | return; |
46 | } | 46 | } |
47 | 47 | ||
48 | void efs_read_inode(struct inode *inode) | 48 | struct inode *efs_iget(struct super_block *super, unsigned long ino) |
49 | { | 49 | { |
50 | int i, inode_index; | 50 | int i, inode_index; |
51 | dev_t device; | 51 | dev_t device; |
52 | u32 rdev; | 52 | u32 rdev; |
53 | struct buffer_head *bh; | 53 | struct buffer_head *bh; |
54 | struct efs_sb_info *sb = SUPER_INFO(inode->i_sb); | 54 | struct efs_sb_info *sb = SUPER_INFO(super); |
55 | struct efs_inode_info *in = INODE_INFO(inode); | 55 | struct efs_inode_info *in; |
56 | efs_block_t block, offset; | 56 | efs_block_t block, offset; |
57 | struct efs_dinode *efs_inode; | 57 | struct efs_dinode *efs_inode; |
58 | 58 | struct inode *inode; | |
59 | |||
60 | inode = iget_locked(super, ino); | ||
61 | if (IS_ERR(inode)) | ||
62 | return ERR_PTR(-ENOMEM); | ||
63 | if (!(inode->i_state & I_NEW)) | ||
64 | return inode; | ||
65 | |||
66 | in = INODE_INFO(inode); | ||
67 | |||
59 | /* | 68 | /* |
60 | ** EFS layout: | 69 | ** EFS layout: |
61 | ** | 70 | ** |
@@ -159,13 +168,13 @@ void efs_read_inode(struct inode *inode) | |||
159 | break; | 168 | break; |
160 | } | 169 | } |
161 | 170 | ||
162 | return; | 171 | unlock_new_inode(inode); |
172 | return inode; | ||
163 | 173 | ||
164 | read_inode_error: | 174 | read_inode_error: |
165 | printk(KERN_WARNING "EFS: failed to read inode %lu\n", inode->i_ino); | 175 | printk(KERN_WARNING "EFS: failed to read inode %lu\n", inode->i_ino); |
166 | make_bad_inode(inode); | 176 | iget_failed(inode); |
167 | 177 | return ERR_PTR(-EIO); | |
168 | return; | ||
169 | } | 178 | } |
170 | 179 | ||
171 | static inline efs_block_t | 180 | static inline efs_block_t |