diff mbox

xfs_io: use fiemap -c param to query cow fork

Message ID 1476972679-571-3-git-send-email-bfoster@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Brian Foster Oct. 20, 2016, 2:11 p.m. UTC
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 io/fiemap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/io/fiemap.c b/io/fiemap.c
index f89da06..9114af1 100644
--- a/io/fiemap.c
+++ b/io/fiemap.c
@@ -206,6 +206,10 @@  calc_print_format(
 	}
 }
 
+#ifndef FIEMAP_FLAG_COW
+#define FIEMAP_FLAG_COW		0x00000010
+#endif
+
 int
 fiemap_f(
 	int		argc,
@@ -231,11 +235,14 @@  fiemap_f(
 	__u64		last_logical = 0;
 	struct stat	st;
 
-	while ((c = getopt(argc, argv, "aln:v")) != EOF) {
+	while ((c = getopt(argc, argv, "acln:v")) != EOF) {
 		switch (c) {
 		case 'a':
 			fiemap_flags |= FIEMAP_FLAG_XATTR;
 			break;
+		case 'c':
+			fiemap_flags |= FIEMAP_FLAG_COW;
+			break;
 		case 'l':
 			lflag = 1;
 			break;