summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-11-13 23:49:16 +0100
committerMark Fasheh <mfasheh@suse.com>2009-01-05 17:36:53 +0100
commit5e96581a377fc6bd76e9b112da9aeb8a7ae8bf22 (patch)
treece2e1d8819b6020567828ca9021438c0824aa8d4 /fs/ocfs2/alloc.h
parentocfs2: Morph the haphazard OCFS2_IS_VALID_GROUP_DESC() checks. (diff)
downloadlinux-5e96581a377fc6bd76e9b112da9aeb8a7ae8bf22.tar.xz
linux-5e96581a377fc6bd76e9b112da9aeb8a7ae8bf22.zip
ocfs2: Wrap extent block reads in a dedicated function.
We weren't consistently checking extent blocks after we read them. Most places checked the signature, but none checked h_blkno or h_fs_signature. Create a toplevel ocfs2_read_extent_block() that does the read and the validation. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/alloc.h')
-rw-r--r--fs/ocfs2/alloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h
index 0fbf8fc55a49..59d37d1b7d4c 100644
--- a/fs/ocfs2/alloc.h
+++ b/fs/ocfs2/alloc.h
@@ -73,6 +73,14 @@ void ocfs2_init_xattr_value_extent_tree(struct ocfs2_extent_tree *et,
struct buffer_head *bh,
struct ocfs2_xattr_value_root *xv);
+/*
+ * Read an extent block into *bh. If *bh is NULL, a bh will be
+ * allocated. This is a cached read. The extent block will be validated
+ * with ocfs2_validate_extent_block().
+ */
+int ocfs2_read_extent_block(struct inode *inode, u64 eb_blkno,
+ struct buffer_head **bh);
+
struct ocfs2_alloc_context;
int ocfs2_insert_extent(struct ocfs2_super *osb,
handle_t *handle,