Re: [PATCH] blkdiscard: add new command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Sep 2012, Karel Zak wrote:

> Date: Thu, 13 Sep 2012 15:57:27 +0200
> From: Karel Zak <kzak@xxxxxxxxxx>
> To: Lukáš Czerner <lczerner@xxxxxxxxxx>
> Cc: Kay Sievers <kay@xxxxxxxx>, util-linux@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] blkdiscard: add new command
> 
> On Thu, Sep 13, 2012 at 09:37:30AM -0400, Lukáš Czerner wrote:
> > On Thu, 13 Sep 2012, Kay Sievers wrote:
> > 
> > > Date: Thu, 13 Sep 2012 00:43:01 +0200
> > > From: Kay Sievers <kay@xxxxxxxx>
> > > To: Lukas Czerner <lczerner@xxxxxxxxxx>
> > > Cc: util-linux@xxxxxxxxxxxxxxx, kzak@xxxxxxxxxx
> > > Subject: Re: [PATCH] blkdiscard: add new command
> > > 
> > > On Wed, Sep 12, 2012 at 11:49 PM, Lukas Czerner <lczerner@xxxxxxxxxx> wrote:
> > > > blkdiscard is used to discard device sectors. This is useful for
> > > > solid-state drivers (SSDs) and thinly-provisioned storage. Unlike
> > > > fstrim this command is used directly on the block device.
> > > 
> > > Should this maybe live in blockdev(8)?
> > > 
> > > It's kind of unfortunate to create standalone tools for every other
> > > rather exotic block device feature.
> > 
> > Discard is hardly exotic feature nowadays :). But anyway, I was not aware of
> > blockdev(8) and indeed it seems like a better place to put this
> > functionality. I'll look into it.
> 
>  That's question ... we already have fstrim which is also wrapper for
>  one ioctl and it seems that your blkdiscard requires some logic
>  (devsize, sectorsize, align ranges, ...). We usually use blockdev
>  for pretty primitive ioctls, add something more complex will be hack
>  (like --getsz or --report).
> 
>  It's UNIX, it's not so unusual that utils do one thing and do it well ;-)
> 
>     Karel

Righ, I've looked at the blockdev(8) and indeed it lacks the ability
to pass more "complex" arguments to the command itself. It would
have to be updated to support this. Most likely to something like
this:

blockdev <blockdev options> <command> <command options>

but I am not sure it worth it. And your UNIX point is quite valid. I
am on the fence about this (with slight inclination to separate blkdiscard),
but you're the maintainer so you have the privilege to decide :)

-Lukas

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux