aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2009-08-17 23:41:57 -0400
committerJoel Becker <joel.becker@oracle.com>2009-09-22 23:09:39 -0400
commit1061f9c1c9f81ed88b5d268a95d8e3ace80da63a (patch)
treede43d1c1122ade36f079f0381712bc0f06556ac5 /fs/ocfs2
parenta9063ab9a3827483007124bdb6f9877f0ab4c3f5 (diff)
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/extent_map.c6
-rw-r--r--fs/ocfs2/extent_map.h3
-rw-r--r--fs/ocfs2/xattr.c7
3 files changed, 11 insertions, 5 deletions
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 40b51056bb32..843db64e9d4a 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -541,7 +541,8 @@ static void ocfs2_relative_extent_offsets(struct super_block *sb,
541 541
542int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, 542int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
543 u32 *p_cluster, u32 *num_clusters, 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 int ret = 0, i; 547 int ret = 0, i;
547 struct buffer_head *eb_bh = NULL; 548 struct buffer_head *eb_bh = NULL;
@@ -593,6 +594,9 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
593 *p_cluster = *p_cluster + coff; 594 *p_cluster = *p_cluster + coff;
594 if (num_clusters) 595 if (num_clusters)
595 *num_clusters = ocfs2_rec_clusters(el, rec) - coff; 596 *num_clusters = ocfs2_rec_clusters(el, rec) - coff;
597
598 if (extent_flags)
599 *extent_flags = rec->e_flags;
596 } 600 }
597out: 601out:
598 if (eb_bh) 602 if (eb_bh)
diff --git a/fs/ocfs2/extent_map.h b/fs/ocfs2/extent_map.h
index 9942f47efda7..e79d41c2c909 100644
--- a/fs/ocfs2/extent_map.h
+++ b/fs/ocfs2/extent_map.h
@@ -55,7 +55,8 @@ int ocfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
55 55
56int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, 56int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
57 u32 *p_cluster, u32 *num_clusters, 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
60int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr, 61int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
61 struct buffer_head *bhs[], int flags, 62 struct buffer_head *bhs[], int flags,
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 1bf12c453f99..dda49c00362a 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -704,7 +704,7 @@ static int ocfs2_xattr_shrink_size(struct inode *inode,
704 while (trunc_len) { 704 while (trunc_len) {
705 ret = ocfs2_xattr_get_clusters(inode, cpos, &phys_cpos, 705 ret = ocfs2_xattr_get_clusters(inode, cpos, &phys_cpos,
706 &alloc_size, 706 &alloc_size,
707 &vb->vb_xv->xr_list); 707 &vb->vb_xv->xr_list, NULL);
708 if (ret) { 708 if (ret) {
709 mlog_errno(ret); 709 mlog_errno(ret);
710 goto out; 710 goto out;
@@ -959,7 +959,7 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode,
959 cpos = 0; 959 cpos = 0;
960 while (cpos < clusters) { 960 while (cpos < clusters) {
961 ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster, 961 ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster,
962 &num_clusters, el); 962 &num_clusters, el, NULL);
963 if (ret) { 963 if (ret) {
964 mlog_errno(ret); 964 mlog_errno(ret);
965 goto out; 965 goto out;
@@ -1198,7 +1198,8 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode,
1198 1198
1199 while (cpos < clusters) { 1199 while (cpos < clusters) {
1200 ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster, 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 if (ret) { 1203 if (ret) {
1203 mlog_errno(ret); 1204 mlog_errno(ret);
1204 goto out; 1205 goto out;