diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-11-13 17:49:11 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:36:52 -0500 |
commit | b657c95c11088d77fc1bfc9c84d940f778bf9d12 (patch) | |
tree | 7e52e73aabbdbc55f644ad26735edc25a652ac32 /fs/ocfs2/journal.c | |
parent | a68979b857283daf4acc405e476dcc8812a3ff2b (diff) |
ocfs2: Wrap inode block reads in a dedicated function.
The ocfs2 code currently reads inodes off disk with a simple
ocfs2_read_block() call. Each place that does this has a different set
of sanity checks it performs. Some check only the signature. A couple
validate the block number (the block read vs di->i_blkno). A couple
others check for VALID_FL. Only one place validates i_fs_generation. A
couple check nothing. Even when an error is found, they don't all do
the same thing.
We wrap inode reading into ocfs2_read_inode_block(). This will validate
all the above fields, going readonly if they are invalid (they never
should be). ocfs2_read_inode_block_full() is provided for the places
that want to pass read_block flags. Every caller is passing a struct
inode with a valid ip_blkno, so we don't need a separate blkno argument
either.
We will remove the validation checks from the rest of the code in a
later commit, as they are no longer necessary.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 99fe9d584f3c..877aaa05e199 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -1135,8 +1135,7 @@ static int ocfs2_read_journal_inode(struct ocfs2_super *osb, | |||
1135 | } | 1135 | } |
1136 | SET_INODE_JOURNAL(inode); | 1136 | SET_INODE_JOURNAL(inode); |
1137 | 1137 | ||
1138 | status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1, bh, | 1138 | status = ocfs2_read_inode_block_full(inode, bh, OCFS2_BH_IGNORE_CACHE); |
1139 | OCFS2_BH_IGNORE_CACHE); | ||
1140 | if (status < 0) { | 1139 | if (status < 0) { |
1141 | mlog_errno(status); | 1140 | mlog_errno(status); |
1142 | goto bail; | 1141 | goto bail; |