All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs_io: use fiemap -c param to query cow fork
Date: Thu, 20 Oct 2016 10:11:19 -0400	[thread overview]
Message-ID: <1476972679-571-3-git-send-email-bfoster@redhat.com> (raw)
In-Reply-To: <1476972679-571-1-git-send-email-bfoster@redhat.com>

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 io/fiemap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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;
-- 
2.7.4


      parent reply	other threads:[~2016-10-20 14:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 14:11 [RFC PATCH] fiemap cow fork flag Brian Foster
2016-10-20 14:11 ` [RFC PATCH] xfs: fiemap support for cow fork Brian Foster
2016-10-20 14:11 ` Brian Foster [this message]

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=1476972679-571-3-git-send-email-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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.