From patchwork Thu Oct 20 14:11:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Foster X-Patchwork-Id: 9485893 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5,RP_MATCHES_RCVD=-0.1 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id 0F0C055307A for ; Thu, 20 Oct 2016 09:11:23 -0500 (CDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932261AbcJTOLX (ORCPT ); Thu, 20 Oct 2016 10:11:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47936 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932345AbcJTOLW (ORCPT ); Thu, 20 Oct 2016 10:11:22 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3A7F80099 for ; Thu, 20 Oct 2016 14:11:21 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-20.bos.redhat.com [10.18.41.20]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9KEBL6q001881 for ; Thu, 20 Oct 2016 10:11:21 -0400 Received: by bfoster.bfoster (Postfix, from userid 1000) id 43BDD120160; Thu, 20 Oct 2016 10:11:20 -0400 (EDT) From: Brian Foster 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 Message-Id: <1476972679-571-3-git-send-email-bfoster@redhat.com> In-Reply-To: <1476972679-571-1-git-send-email-bfoster@redhat.com> References: <1476972679-571-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 20 Oct 2016 14:11:21 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Signed-off-by: Brian Foster --- 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;