Andrew, Please could you Ack this patch. This adds a new FIEMAP flag to denote shared extents which we are using to identify such exents in reflinked files. Thanks Sunil
Sunil Mushran
2009-Dec-03 20:46 UTC
[Ocfs2-devel] [PATCH 1/2] fiemap: Add new extent flag FIEMAP_EXTENT_SHARED
Patch adds flag FIEMAP_EXTENT_SHARED to denote extents that are shared with other inodes. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> Acked-by: Mark Fasheh <mfasheh at suse.com> --- include/linux/fiemap.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h index 934e22d..d830747 100644 --- a/include/linux/fiemap.h +++ b/include/linux/fiemap.h @@ -62,5 +62,7 @@ struct fiemap { #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively * support extents. Result * merged for efficiency. */ +#define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other + * files. */ #endif /* _LINUX_FIEMAP_H */ -- 1.5.6.5
Sunil Mushran
2009-Dec-03 20:46 UTC
[Ocfs2-devel] [PATCH 2/2] ocfs2: Use FIEMAP_EXTENT_SHARED
Adds FIEMAP_EXTENT_SHARED flag to refcounted extents. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> Acked-by: Mark Fasheh <mfasheh at suse.com> --- fs/ocfs2/extent_map.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index 843db64..cdce5f8 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c @@ -786,6 +786,8 @@ int ocfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, fe_flags = 0; if (rec.e_flags & OCFS2_EXT_UNWRITTEN) fe_flags |= FIEMAP_EXTENT_UNWRITTEN; + if (rec.e_flags & OCFS2_EXT_REFCOUNTED) + fe_flags |= FIEMAP_EXTENT_SHARED; if (is_last) fe_flags |= FIEMAP_EXTENT_LAST; len_bytes = (u64)le16_to_cpu(rec.e_leaf_clusters) << osb->s_clustersize_bits; -- 1.5.6.5
On Thu, Dec 03, 2009 at 12:46:50PM -0800, Sunil Mushran wrote:> Please could you Ack this patch. This adds a new FIEMAP flag to denote > shared extents which we are using to identify such exents in reflinked > files.These patches are now in ocfs2.git. If anyone has any concerns, let me know. Joel -- Life's Little Instruction Book #464 "Don't miss the magic of the moment by focusing on what's to come." Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127
On 2009-12-17, at 22:10, Joel Becker wrote:> On Thu, Dec 03, 2009 at 12:46:50PM -0800, Sunil Mushran wrote: >> Please could you Ack this patch. This adds a new FIEMAP flag to >> denote >> shared extents which we are using to identify such exents in >> reflinked >> files. > > These patches are now in ocfs2.git. If anyone has any concerns, > let me know.Hi Joel, are there any plans to submit an e2fsprogs patch to print out the "shared" extent flag from "filefrag"? At first glance it would also seem to make sense to set this flag for ext2/3/4 xattrs that are sharing an external extent block. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.
Andreas Dilger wrote:> Hi Joel, > are there any plans to submit an e2fsprogs patch to print out the > "shared" extent flag from "filefrag"? > > At first glance it would also seem to make sense to set this flag for > ext2/3/4 xattrs that are sharing an external extent block.Yes, I do have a patch for filefrag which I will push after this gets into mainline.