All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 26/39] ocfs2: Return extent flags for xattr value tree.
Date: Thu, 30 Apr 2009 06:58:38 +0800	[thread overview]
Message-ID: <1241045931-24607-26-git-send-email-tao.ma@oracle.com> (raw)
In-Reply-To: <49F95A79.6040806@oracle.com>

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>
---
 fs/ocfs2/extent_map.c |    6 +++++-
 fs/ocfs2/extent_map.h |    3 ++-
 fs/ocfs2/xattr.c      |    7 ++++---
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 40b5105..843db64 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,
 
 int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
 			     u32 *p_cluster, u32 *num_clusters,
-			     struct ocfs2_extent_list *el)
+			     struct ocfs2_extent_list *el,
+			     unsigned int *extent_flags)
 {
 	int ret = 0, i;
 	struct buffer_head *eb_bh = NULL;
@@ -593,6 +594,9 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
 		*p_cluster = *p_cluster + coff;
 		if (num_clusters)
 			*num_clusters = ocfs2_rec_clusters(el, rec) - coff;
+
+		if (extent_flags)
+			*extent_flags = rec->e_flags;
 	}
 out:
 	if (eb_bh)
diff --git a/fs/ocfs2/extent_map.h b/fs/ocfs2/extent_map.h
index 9942f47..e79d41c 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,
 
 int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
 			     u32 *p_cluster, u32 *num_clusters,
-			     struct ocfs2_extent_list *el);
+			     struct ocfs2_extent_list *el,
+			     unsigned int *extent_flags);
 
 int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
 			   struct buffer_head *bhs[], int flags,
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index dbc1e08..96c4d49 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -704,7 +704,7 @@ static int ocfs2_xattr_shrink_size(struct inode *inode,
 	while (trunc_len) {
 		ret = ocfs2_xattr_get_clusters(inode, cpos, &phys_cpos,
 					       &alloc_size,
-					       &vb->vb_xv->xr_list);
+					       &vb->vb_xv->xr_list, NULL);
 		if (ret) {
 			mlog_errno(ret);
 			goto out;
@@ -959,7 +959,7 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode,
 	cpos = 0;
 	while (cpos < clusters) {
 		ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster,
-					       &num_clusters, el);
+					       &num_clusters, el, NULL);
 		if (ret) {
 			mlog_errno(ret);
 			goto out;
@@ -1197,7 +1197,8 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode,
 
 	while (cpos < clusters) {
 		ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster,
-					       &num_clusters, &xv->xr_list);
+					       &num_clusters, &xv->xr_list,
+					       NULL);
 		if (ret) {
 			mlog_errno(ret);
 			goto out;
-- 
1.6.2.rc2.16.gf474c

  parent reply	other threads:[~2009-04-29 22:58 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30  7:59 [Ocfs2-devel] [PATCH 00/39] ocfs2: Add reflink file support. V3 Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 01/39] ocfs2: Define refcount tree structure Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 02/39] ocfs2: Add metaecc for ocfs2_refcount_block Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 03/39] ocfs2: Add ocfs2_read_refcount_block Tao Ma
2009-04-30 23:17   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 04/39] ocfs2: Basic tree root operation Tao Ma
2009-04-30 23:33   ` Joel Becker
2009-05-01  6:47     ` Tao Ma
2009-05-02  3:55   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 05/39] ocfs2: hook remove refcount tree into truncate Tao Ma
2009-04-30 23:35   ` Joel Becker
2009-05-01  6:48     ` Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 06/39] ocfs2: Wrap ocfs2_extent_contig in ocfs2_extent_tree Tao Ma
2009-04-30 23:43   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 07/39] ocfs2: Abstract extent split process Tao Ma
2009-04-30 23:57   ` Joel Becker
2009-05-05  6:35     ` Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 08/39] ocfs2: Add refcount b-tree as a new extent tree Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 09/39] ocfs2: export tree operation functions Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 10/39] ocfs2: Add support for incrementing refcount in the tree Tao Ma
2009-05-02  3:53   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 11/39] ocfs2: Add support of decrementing refcount for delete Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 12/39] ocfs2: Add functions for extents refcounted Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 13/39] ocfs2: Hook 'Decrement refcount for delete' Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 14/39] ocfs2: Add CoW support Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 15/39] ocfs2: CoW refcount tree improvement Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 16/39] ocfs2: Add __ocfs2_reflink Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 17/39] ocfs2: Add ioctl for reflink Tao Ma
2009-05-01  7:34   ` Christoph Hellwig
2009-05-01 11:19     ` Joel Becker
2009-05-02 14:14       ` Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 18/39] ocfs2: Use proper parameter for some inode operation Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 19/39] ocfs2: Create reflinked file in orphan dir Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 20/39] ocfs2: Abstract caching info checkpoint Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 21/39] ocfs2: Add new refcount tree lock resource Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 22/39] ocfs2: Add refcount tree lock mechanism Tao Ma
2009-05-08  1:17   ` Joel Becker
2009-05-08  1:41     ` Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 23/39] ocfs2: lock refcount tree if needed Tao Ma
2009-05-08  1:30   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 24/39] ocfs2: Add caching info for refcount tree Tao Ma
2009-05-08  1:32   ` Joel Becker
2009-05-08  1:50     ` Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 25/39] ocfs2: Add refcount tree find mechanism from an inode Tao Ma
2009-04-29 22:58 ` Tao Ma [this message]
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 27/39] ocfs2: Abstract duplicate clusters process in CoW Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 28/39] ocfs2: Add CoW support for xattr Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 29/39] ocfs2: Remove inode from ocfs2_xattr_bucket_get_name_value Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 30/39] ocfs2: Abstract the creation of xattr block Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 31/39] ocfs2: Abstract ocfs2 xattr tree extend rec iteration process Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 32/39] ocfs2: Attach xattr clusters to refcount tree Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 33/39] ocfs2: Call refcount tree remove process properly Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 34/39] ocfs2: Create an xattr indexed block if needed Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 35/39] ocfs2: Add reflink support for xattr Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 36/39] ocfs2: Modify removing xattr process for refcount Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 37/39] ocfs2: Don't merge in 1st refcount ops of reflink Tao Ma
2009-05-08  1:38   ` Joel Becker
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 38/39] ocfs2: Make transaction extend more efficient Tao Ma
2009-04-29 22:58 ` [Ocfs2-devel] [PATCH 39/39] ocfs2: Enable refcount tree support Tao Ma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1241045931-24607-26-git-send-email-tao.ma@oracle.com \
    --to=tao.ma@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.