diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-08-23 23:13:37 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-22 23:09:29 -0400 |
commit | 374a263e790c4de85844283c098810a92985f623 (patch) | |
tree | a72b1f072b973723ea1cf7def27608717cf1c033 /fs/ocfs2/refcounttree.h | |
parent | c732eb16bf07f9bfb7fa72b6868462471273bdbd (diff) |
ocfs2: Add refcount tree lock mechanism.
Implement locking around struct ocfs2_refcount_tree. This protects
all read/write operations on refcount trees. ocfs2_refcount_tree
has its own lock and its own caching_info, protecting buffers among
multiple nodes.
User must call ocfs2_lock_refcount_tree before his operation on
the tree and unlock it after that.
ocfs2_refcount_trees are referenced by the block number of the
refcount tree root block, So we create an rb-tree on the ocfs2_super
to look them up.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/refcounttree.h')
-rw-r--r-- | fs/ocfs2/refcounttree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ocfs2/refcounttree.h b/fs/ocfs2/refcounttree.h index 9a3695cdbb53..2ea7fc52c23c 100644 --- a/fs/ocfs2/refcounttree.h +++ b/fs/ocfs2/refcounttree.h | |||
@@ -33,4 +33,11 @@ struct ocfs2_refcount_tree { | |||
33 | struct super_block *rf_sb; | 33 | struct super_block *rf_sb; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | void ocfs2_purge_refcount_trees(struct ocfs2_super *osb); | ||
37 | int ocfs2_lock_refcount_tree(struct ocfs2_super *osb, u64 ref_blkno, int rw, | ||
38 | struct ocfs2_refcount_tree **tree, | ||
39 | struct buffer_head **ref_bh); | ||
40 | void ocfs2_unlock_refcount_tree(struct ocfs2_super *osb, | ||
41 | struct ocfs2_refcount_tree *tree, | ||
42 | int rw); | ||
36 | #endif /* OCFS2_REFCOUNTTREE_H */ | 43 | #endif /* OCFS2_REFCOUNTTREE_H */ |