Commit 1061f9c1c9f81ed88b5d268a95d8e3ace80da63a
Committed by
Joel Becker
1 parent
a9063ab9a3
Exists in
master
and in
39 other branches
ocfs2: Return extent flags for xattr value tree.
With the new refcount tree, xattr value can also be refcounted among multiple files. So return the appropriate extent flags so that CoW can used it later. Signed-off-by: Tao Ma <tao.ma@oracle.com>
Showing 3 changed files with 11 additions and 5 deletions Side-by-side Diff
fs/ocfs2/extent_map.c
... | ... | @@ -541,7 +541,8 @@ |
541 | 541 | |
542 | 542 | int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, |
543 | 543 | u32 *p_cluster, u32 *num_clusters, |
544 | - struct ocfs2_extent_list *el) | |
544 | + struct ocfs2_extent_list *el, | |
545 | + unsigned int *extent_flags) | |
545 | 546 | { |
546 | 547 | int ret = 0, i; |
547 | 548 | struct buffer_head *eb_bh = NULL; |
... | ... | @@ -593,6 +594,9 @@ |
593 | 594 | *p_cluster = *p_cluster + coff; |
594 | 595 | if (num_clusters) |
595 | 596 | *num_clusters = ocfs2_rec_clusters(el, rec) - coff; |
597 | + | |
598 | + if (extent_flags) | |
599 | + *extent_flags = rec->e_flags; | |
596 | 600 | } |
597 | 601 | out: |
598 | 602 | if (eb_bh) |
fs/ocfs2/extent_map.h
... | ... | @@ -55,7 +55,8 @@ |
55 | 55 | |
56 | 56 | int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, |
57 | 57 | u32 *p_cluster, u32 *num_clusters, |
58 | - struct ocfs2_extent_list *el); | |
58 | + struct ocfs2_extent_list *el, | |
59 | + unsigned int *extent_flags); | |
59 | 60 | |
60 | 61 | int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr, |
61 | 62 | struct buffer_head *bhs[], int flags, |
fs/ocfs2/xattr.c
... | ... | @@ -704,7 +704,7 @@ |
704 | 704 | while (trunc_len) { |
705 | 705 | ret = ocfs2_xattr_get_clusters(inode, cpos, &phys_cpos, |
706 | 706 | &alloc_size, |
707 | - &vb->vb_xv->xr_list); | |
707 | + &vb->vb_xv->xr_list, NULL); | |
708 | 708 | if (ret) { |
709 | 709 | mlog_errno(ret); |
710 | 710 | goto out; |
... | ... | @@ -959,7 +959,7 @@ |
959 | 959 | cpos = 0; |
960 | 960 | while (cpos < clusters) { |
961 | 961 | ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster, |
962 | - &num_clusters, el); | |
962 | + &num_clusters, el, NULL); | |
963 | 963 | if (ret) { |
964 | 964 | mlog_errno(ret); |
965 | 965 | goto out; |
... | ... | @@ -1198,7 +1198,8 @@ |
1198 | 1198 | |
1199 | 1199 | while (cpos < clusters) { |
1200 | 1200 | ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster, |
1201 | - &num_clusters, &xv->xr_list); | |
1201 | + &num_clusters, &xv->xr_list, | |
1202 | + NULL); | |
1202 | 1203 | if (ret) { |
1203 | 1204 | mlog_errno(ret); |
1204 | 1205 | goto out; |