I do like the subcommand method, more details below.

On Wed, Feb 17, 2010 at 03:35:26PM -0800, Mike Fedyk wrote:
> I think he need some command hierarchy here.
> 
> On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli
> <kreij...@gmail.com> wrote:
> > OPTIONS
> >       snapshot|-s <source> [<dest>/]<name>
> >              Create a writeble snapshot of the subvolume  <source>  with  
> > the
> >              name  <name>  in the <dest> directory. If <source> is not a 
> > sub‐
> >              volume, btrfs returns an error.
> 
> This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
> It only works on subvolumes.

If we can type subvol instead of subvolume I like it.  Basically the
perl/python arg parsing system where any short form of the command that
uniquely matches it is allowed.

We keep the long forms but allow the user to pick a shorter form if it
isn't ambiguous.

> 
> >
> >
> >       delete|-D <subvolume>
> >              Delete the subvolume <subvolume>. If <subvolume> is not  a  
> > sub‐
> >              volume, btrfs returns an error.
> >
> 
> This becomes:
> 
> btrfs subvolume delete <subvolume>

subvol del (same as above).

> 
> This works with snapshots as well.
> 
> >
> >       subvolume|-c [<dest>/]<name>
> >              Create  a  subvolume  in  <dest> (or in the current directory 
> > if
> >              <dest> is not passed).
> 
> btrfs subvolume create [<dest>/]<name>
> 
> >
> >
> >       defrag|-f <file>|<dir> [<file>|<dir>...]
> >              Defragment files and/or directories.
> 
> This will defrag individual files?  Does it defrag a directory tree?
> Does it defrag a subvolume?  Does it defrag a pool?

For now lets change this to only do files.  That's the only thing the
tool supports today.

> 
> >
> >
> >       scan|-n [<device> [<device>..]]
> >              Scan devices for a btrfs filesystem. If no devices  are  
> > passed,
> >              btrfs scans all the block devices.
> 
> btrfs pool scan [<device> [<device>..]]

Instead of btrfs pool, please use btrfs dev

> 
> >
> >
> >       fssync|-y <path>
> >              Force a sync for the filesystem identified by <path>.
> >
> 
> Does it sync a pool or subvolume?  Assuming it works against
> subvolumes, it would be:
> 
> btrfs subvolume sync <path>
> 
> >
> >
> >       resize|-z [+/-]<size>[gkm]|max <filesystem>
> >              Resize a file system identified by <path>.  The <size> 
> > parameter
> >              specifies the new size of the filesystem.  If the prefix + or  
> > -
> >              is  present  the  size is increased or decreased by the 
> > quantity
> >              <size>.  If no units are  specified,  the  unit  of  the  
> > <size>
> >              parameter  is  the  byte.  Optionally, the size parameter may 
> > be
> >              suffixed by one of the following  the  units  designators:  
> > 'K',
> >              'M', or 'G', kilobytes, megabytes, or gigabytes, respectively.
> >
> >              If  'max'  is  passed,  the filesystem will occupy all 
> > available
> >              space on the volume(s).
> >
> >              The resize command does not manipulate the  size  of  
> > underlying
> >              partitions.   If  you  wish  to enlarge/reduce a filesystem, 
> > you
> >              must make sure you can expand/reduce the size of  the  
> > partition
> >              also.
> >
> 
> This works with physical devices, not a pool or subvolume.  I get the
> name "physical volume" from lvm.  Also I think it should resize to max
> without arguments, in order to do that, the size argument would need
> to be the last argument.

We don't have physical volumes and logical volumes the way lvm does, so
I'd like to avoid the pvolume theme.

> 
> It becomes:
> 
> btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem>
> 
> Or:
> 
> btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]

btrfs dev resize

> 
> >
> >       show|-l [<dev>|<label>...]
> >              Show  the btrfs devices with some additional info. If no 
> > devices
> >              or labels are passed, btrfs scans all the block devices.
> 
> This becomes:
> 
> btrfs pool show [<dev>|<label>...]

btrfs dev show

> 
> >
> >
> >       balance|-b <path>
> >              Balance the chunk of the filesystem identified by <path>  
> > across
> >              the devices.
> 
> Is path to one of the block devices in the pool?
> 
> This becomes:
> 
> btrfs pool balance <path>

btrfs dev balance

> 
> >
> >
> >       add-dev|-A  <dev> [<dev>..] <path>
> >              Add device(s) to the filesystem identified by <path>.
> 
> What is path?  Somewhere the pool is mounted?  The root of where the
> pool is mounted?

The path just tells us which filesystem to work against.  It can really
be any path inside the mount point.

> 
> this becomes:
> 
> btrfs pvolume add <dev> [<dev>..] <path>

btrfs dev add 
> 
> >
> >
> >       rm-dev|-R  <dev> [<dev>..] <path>
> >              Remove device(s) to the filesystem identified by <path>.
> 
> (same questions as with add)
> 
> This becomes:
> 
> btrfs pvolume remove <dev> [<dev>..] <path>

btrfs dev remove

-chris

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to