diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-08-17 23:43:17 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-22 23:09:41 -0400 |
commit | 492a8a33e1cb966fa0b5756c5fc11d30c8f8848e (patch) | |
tree | eacf691b07c8fa3e81c11ff1d6b8773c2dbb9e77 /fs/ocfs2/refcounttree.h | |
parent | 913580b4cd445c4fb25d7cf167911a8cf6bdb1eb (diff) |
ocfs2: Add CoW support for xattr.
In order to make 2 transcation(xattr and cow) independent with each other,
we CoW the whole xattr out in case we are setting them.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/refcounttree.h')
-rw-r--r-- | fs/ocfs2/refcounttree.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/ocfs2/refcounttree.h b/fs/ocfs2/refcounttree.h index 356f99c85635..d09d64b29810 100644 --- a/fs/ocfs2/refcounttree.h +++ b/fs/ocfs2/refcounttree.h | |||
@@ -54,4 +54,33 @@ int ocfs2_prepare_refcount_change_for_del(struct inode *inode, | |||
54 | struct ocfs2_alloc_context **meta_ac); | 54 | struct ocfs2_alloc_context **meta_ac); |
55 | int ocfs2_refcount_cow(struct inode *inode, struct buffer_head *di_bh, | 55 | int ocfs2_refcount_cow(struct inode *inode, struct buffer_head *di_bh, |
56 | u32 cpos, u32 write_len, u32 max_cpos); | 56 | u32 cpos, u32 write_len, u32 max_cpos); |
57 | |||
58 | typedef int (ocfs2_post_refcount_func)(struct inode *inode, | ||
59 | handle_t *handle, | ||
60 | void *para); | ||
61 | /* | ||
62 | * Some refcount caller need to do more work after we modify the data b-tree | ||
63 | * during refcount operation(including CoW and add refcount flag), and make the | ||
64 | * transaction complete. So it must give us this structure so that we can do it | ||
65 | * within our transaction. | ||
66 | * | ||
67 | */ | ||
68 | struct ocfs2_post_refcount { | ||
69 | int credits; /* credits it need for journal. */ | ||
70 | ocfs2_post_refcount_func *func; /* real function. */ | ||
71 | void *para; | ||
72 | }; | ||
73 | |||
74 | int ocfs2_refcounted_xattr_delete_need(struct inode *inode, | ||
75 | struct ocfs2_caching_info *ref_ci, | ||
76 | struct buffer_head *ref_root_bh, | ||
77 | struct ocfs2_xattr_value_root *xv, | ||
78 | int *meta_add, int *credits); | ||
79 | int ocfs2_refcount_cow_xattr(struct inode *inode, | ||
80 | struct ocfs2_dinode *di, | ||
81 | struct ocfs2_xattr_value_buf *vb, | ||
82 | struct ocfs2_refcount_tree *ref_tree, | ||
83 | struct buffer_head *ref_root_bh, | ||
84 | u32 cpos, u32 write_len, | ||
85 | struct ocfs2_post_refcount *post); | ||
57 | #endif /* OCFS2_REFCOUNTTREE_H */ | 86 | #endif /* OCFS2_REFCOUNTTREE_H */ |