linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Yang <chenyang.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs-progs: introduce '-p' option and <fullpath> into subvolume set-default command
Date: Thu, 11 Oct 2012 10:06:21 +0800	[thread overview]
Message-ID: <5076299D.2050605@cn.fujitsu.com> (raw)
In-Reply-To: <20121009144406.GR4405@twin.jikos.cz>

On 2012-10-9 22:44, David Sterba wrote:
> On Mon, Sep 24, 2012 at 02:42:13PM +0800, Chen Yang wrote:
>> In command "btrfs subvolume set-default", we used subvolume <id> and <path>
>> to set the default subvolume of a filesystem. It's not easy for a common
>> user,
> 
> What is not easy? How often do you set-default subvolume that it's a
> concern to do it in two steps (list and set-default)?
> 
This patch is mean to improve the UI
If the description above if improper, I will fix it.

>> so I improved it and the <fullpath> of a subvolume can be used to
>> set the default subvolume of a filesystem.
> 
> Setting the default directly from a given path would be a good UI
> improvement.
> 
>> @@ -601,23 +602,66 @@ static int cmd_subvol_get_default(int argc, char **argv)
>>  static const char * const cmd_subvol_set_default_usage[] = {
>> -	"btrfs subvolume set-default <subvolid> <path>",
>> +	"btrfs subvolume set-default [-p] [<subvolid>] <path>",
> 
> This new syntax allows these forms:
> 
> 	1. set-default /path
The "path" must be a subvolume path
> 	2. set-default -p /path
The "path" can be any path under a mount point, if path is not a subvolume, 
The parent tree (subvolume) of the path will be find out and set to be default
> 	3. set-default id /path
current behaviour
> 	4. set-default -p id /path
Error! The improper description of the usage causes this misuse, I will fix it.
> 
> 3 is the current behaviour, can you please explain the rest to me? I'm
> afraid I'm not following the idea.
> 
I'm sorry to make you confused for giving an unclear usage about the new option of the command. 
I'm writing a new version. I will send it later.

>>  	"Set the default subvolume of a filesystem",
>> +	"-p    Set the parent tree(subvolume) of the PATH",
>> +	"      as the default subvolume, if PATH is not a subvolume",
> 
> "if PATH is not a subvolume" -- so I don't specify the mountpoint for
> PATH and I'm supposed to know if the path is or is not a subvolume --
> this is another step I need to do (because I want to be sure that I'm
> setting the right subvol), this does not save the commands compared to
> the current status.
The option “-p” is only used like this “set-default -p /path”, 
if PATH is not a subvolume -p" will help to find the parent tree (subvolume) of the PATH, and set it default.
> 
>>  	NULL
>>  };
> 
> thanks,
> david
> 

thanks for your advise,
chen yang

      reply	other threads:[~2012-10-11  2:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24  6:42 [PATCH] Btrfs-progs: introduce '-p' option and <fullpath> into subvolume set-default command Chen Yang
2012-10-09 14:44 ` David Sterba
2012-10-11  2:06   ` Chen Yang [this message]

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=5076299D.2050605@cn.fujitsu.com \
    --to=chenyang.fnst@cn.fujitsu.com \
    --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).