Re: [PATCH v3 2/2] fiemap: Implement ranged query

Dave Chinner
2017-11-14T20:52:30Z

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