[Ocfs2-devel] [RFC PATCH 1/3] fiemap: Introduce FIEMAP_FLAG_COW flag to map shared extents

Jeff Liu jeff.liu at oracle.com
Tue Feb 19 19:59:22 PST 2013


Introduce a new flag FIEMAP_FLAG_COW to fiemap ioctl(2) interface.

If this flag is set, the kernel will only return the mapped extents
which are in copy-on-write state.

Signed-off-by: Jie Liu <jeff.liu at oracle.com>
Cc: Alexander Viro <viro at zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger at dilger.ca>
Cc: Dave Chinner <david at fromorbit.com>
Cc: Mark Fasheh <mfasheh at suse.com>
Cc: Joel Becker <jlbec at evilplan.org>
Cc: Jan Kara <jack at suse.de>
Cc: Chris Mason <chris.mason at fusionio.com>
Cc: Christoph Hellwig <hch at infradead.org>

---
 include/uapi/linux/fiemap.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/fiemap.h b/include/uapi/linux/fiemap.h
index d830747..693dff4 100644
--- a/include/uapi/linux/fiemap.h
+++ b/include/uapi/linux/fiemap.h
@@ -40,8 +40,10 @@ struct fiemap {
 
 #define FIEMAP_FLAG_SYNC	0x00000001 /* sync file data before map */
 #define FIEMAP_FLAG_XATTR	0x00000002 /* map extended attribute tree */
+#define FIEMAP_FLAG_COW		0x00000004 /* map copy-on-write extents */
 
-#define FIEMAP_FLAGS_COMPAT	(FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
+#define FIEMAP_FLAGS_COMPAT	(FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR | \
+				 FIEMAP_FLAG_COW)
 
 #define FIEMAP_EXTENT_LAST		0x00000001 /* Last extent in file. */
 #define FIEMAP_EXTENT_UNKNOWN		0x00000002 /* Data location unknown. */
-- 
1.7.9.5



More information about the Ocfs2-devel mailing list