linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: David Sterba <dsterba@suse.cz>,
	chris.mason@fusionio.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: join DEV_STATS ioctls to one
Date: Fri, 22 Jun 2012 19:21:30 +0200	[thread overview]
Message-ID: <4FE4A99A.3090000@giantdisaster.de> (raw)
In-Reply-To: <20120622170216.GA28144@twin.jikos.cz>

On 06/22/2012 19:02 +0200, David Sterba wrote:
> On Fri, Jun 22, 2012 at 06:26:44PM +0200, Stefan Behrens wrote:
>> I still do not understand your reason and the benefit of your change.
>> The reset command and the read command are two completely different
>> operations. Therefore I assigned two different ioctl commands. Then you
>> can use strace to see which command is sent, and you can also grep the
>> sources without additional effort.
>
> I'll try better.
>
> I see the primary purpose to read the device stats.  A standalone stats
> reset ioctl does not make much sense, so it should go along with reading
> the last state and then reset. So far ok.
>
> .From implementation and interface POV, the reset is a hint how I want
> to read the stats, not directly the command.
>
> The switch whether to do the reset or not, as currently implemented, has
> to set the ioctl number, while I'd expect to set a flag.
>
> Other concerns are about future adding more flags or reading them back
> from kernel. I don't have examples, this is what I base on my experience
> that such things happen and then I can only scratch my head 'why didn't
> I add just one more byte there'. Spare bytes avoid some of backward
> compatibility problems.
>
> As for strace, it could be taught to be verbose and descriptive about
> ioctls arguments (the 3rd parameter). Quick example is
>
> $ strace stty sane
> ...
> ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
> ...
>
> Currently, strace does not know about btrfs-specific ioctls, eg snapshot:
>
> ioctl(3, 0x50009417, 0x7ffff4ae8850)    = 0
>
>
> david

OK. Then let's do it your way. I will prepare the patch to adapt the 
btrfs-progs side, unless you have already created one.

  reply	other threads:[~2012-06-22 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 12:30 [PATCH] btrfs: join DEV_STATS ioctls to one David Sterba
2012-06-22 13:33 ` Josef Bacik
2012-06-22 16:26 ` Stefan Behrens
2012-06-22 17:02   ` David Sterba
2012-06-22 17:21     ` Stefan Behrens [this message]
2012-06-22 17:16   ` Josef Bacik

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=4FE4A99A.3090000@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=chris.mason@fusionio.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).