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>
This commit is contained in:
Tao Ma
2009-08-24 11:13:37 +08:00
committed by Joel Becker
父節點 c732eb16bf
當前提交 374a263e79
共有 4 個文件被更改,包括 375 次插入0 次删除

查看文件

@@ -33,4 +33,11 @@ struct ocfs2_refcount_tree {
struct super_block *rf_sb;
};
void ocfs2_purge_refcount_trees(struct ocfs2_super *osb);
int ocfs2_lock_refcount_tree(struct ocfs2_super *osb, u64 ref_blkno, int rw,
struct ocfs2_refcount_tree **tree,
struct buffer_head **ref_bh);
void ocfs2_unlock_refcount_tree(struct ocfs2_super *osb,
struct ocfs2_refcount_tree *tree,
int rw);
#endif /* OCFS2_REFCOUNTTREE_H */