From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:8230 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756630AbdKNUwa (ORCPT ); Tue, 14 Nov 2017 15:52:30 -0500 Date: Wed, 15 Nov 2017 07:52:26 +1100 From: Dave Chinner Subject: Re: [PATCH v3 2/2] fiemap: Implement ranged query Message-ID: <20171114205226.GB4094@dastard> References: <1510588073-5665-1-git-send-email-nborisov@suse.com> <1510588073-5665-2-git-send-email-nborisov@suse.com> <20171113214457.GX4094@dastard> <3491ce98-b744-90de-e01b-83f13abadfa9@sandeen.net> <6619a7bc-ecc1-b8aa-82d0-1747ee812463@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen Cc: Nikolay Borisov , linux-xfs@vger.kernel.org, fstests@vger.kernel.org, eguan@redhat.com, darrick.wong@oracle.com On Tue, Nov 14, 2017 at 07:31:34AM -0600, Eric Sandeen wrote: > > > On 11/14/17 12:32 AM, Nikolay Borisov wrote: > > > > > > On 14.11.2017 00:22, Eric Sandeen wrote: > >> On 11/13/17 4:05 PM, Nikolay Borisov wrote: > > ... > > >>> You are right this is a bit ugly, but it seems more consistend to me, > >>> rather than something like > >>> > >>> xfs_io -c "fiemap -r -n 10 -v 4k 10k" for example. And the reason why > >>> I'm using this hackish way and not declaring r as r: in getopt is > >>> because getopt doesn't recognise when a parameter takes more than 1 > >>> argument. > >> > >> Sorry for chiming in so late after all the go-rounds, but: > >> > >> Why not just drop -r entirely, and make fiemap go into ranged mode iff a > >> range is specified at the end of the command, i.e.: > >> > >> fiemap [ -alv ] [ -n nx ] [ offset length ] > > > > V2 was like that but it required some changing to the generic code which > > detects the presence of this feature and Dave objected hence v3. > > Ok, sorry for being so behind and rehashing old discussions. Let me look > at that. I suggested "-r" because of the fact that you can't detect optional parameters in fstests without jumping through really nasty hoops involving regex line noise. Cheers, Daves. -- Dave Chinner david@fromorbit.com