From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Liu Date: Wed, 20 Feb 2013 11:59:22 +0800 Subject: [Ocfs2-devel] [RFC PATCH 1/3] fiemap: Introduce FIEMAP_FLAG_COW flag to map shared extents Message-ID: <51244A1A.7060105@oracle.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "linux-fsdevel@vger.kernel.org" Cc: Alexander Viro , Andreas Dilger , Dave Chinner , Mark Fasheh , Joel Becker , Jan Kara , Chris Mason , Christoph Hellwig , ocfs2-devel@oss.oracle.com 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 Cc: Alexander Viro Cc: Andreas Dilger Cc: Dave Chinner Cc: Mark Fasheh Cc: Joel Becker Cc: Jan Kara Cc: Chris Mason Cc: Christoph Hellwig --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Liu Subject: [RFC PATCH 1/3] fiemap: Introduce FIEMAP_FLAG_COW flag to map shared extents Date: Wed, 20 Feb 2013 11:59:22 +0800 Message-ID: <51244A1A.7060105@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Viro , Andreas Dilger , Dave Chinner , Mark Fasheh , Joel Becker , Jan Kara , Chris Mason , Christoph Hellwig , ocfs2-devel@oss.oracle.com To: "linux-fsdevel@vger.kernel.org" Return-path: Received: from userp1040.oracle.com ([156.151.31.81]:32886 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934912Ab3BTEAq (ORCPT ); Tue, 19 Feb 2013 23:00:46 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 Cc: Alexander Viro Cc: Andreas Dilger Cc: Dave Chinner Cc: Mark Fasheh Cc: Joel Becker Cc: Jan Kara Cc: Chris Mason Cc: Christoph Hellwig --- 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