linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <liub.liubo@gmail.com>
To: kreijack@inwind.it
Cc: Goffredo Baroncelli <kreijack@libero.it>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/3] Btrfs-progs: list snapshots by generation
Date: Wed, 01 Aug 2012 19:28:58 +0800	[thread overview]
Message-ID: <501912FA.2010200@gmail.com> (raw)
In-Reply-To: <50184B40.8010508@libero.it>

On 08/01/2012 05:16 AM, Goffredo Baroncelli wrote:
> Hi Bo,
> 
> On 07/31/2012 07:49 AM, Liu Bo wrote:
>> The idea is that we usually use snapshot to backup/restore our data, and the
>> common way can be a cron script which makes lots of snapshots, so we can end
>> up with spending some time to find the latest snapshot to restore.
>>
>> This adds a feature for 'btrfs subvolume list' to let it list snapshots by their
>> _created_ generation.
>>
>> What we need to do is just to list them in descending order and get the latest
>> snapshot.  What's more, we can find the oldest snapshot as well by listing
>> snapshots in ascending order.
>>
>> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
>> ---
>>  btrfs-list.c     |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
>>  cmds-subvolume.c |   19 +++++-
>>  2 files changed, 185 insertions(+), 10 deletions(-)
>>
> [....]
>>  
>>  static const char * const cmd_subvol_list_usage[] = {
>> -	"btrfs subvolume list [-p] <path>",
>> +	"btrfs subvolume list [-ps] <path>",
>>  	"List subvolumes (and snapshots)",
>>  	"",
>> -	"-p     print parent ID",
>> +	"-p           print parent ID",
>> +	"-s value     list snapshots with generation in ascending/descending order",
>> +	"             (1: ascending, 0: descending)",
> 
> Please change the user interface. I suggest something like:
> 
> -s|-S		list snapshots with generation in ascending|descending
> 		order	
> 
> Or better
> 
> -s		sort by generation
> -P		sort by path
> -r		reverse the sort order
> 

I prefer to the first one, since I have no any idea how to sort by path
by then.

> 
> Anyway, whichever your choice will be, please remember to update the man
> page too.
> 

ah, I should have remembered to update it, thanks for reminding. :)

Will do it soon, thanks for reviewing this!

thanks,
liubo

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


  reply	other threads:[~2012-08-01 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  5:49 [PATCH 1/3 RESEND] Btrfs-progs: search subvolumes with proper objectid Liu Bo
2012-07-31  5:49 ` [PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list Liu Bo
2012-07-31  5:49 ` [PATCH 3/3] Btrfs-progs: list snapshots by generation Liu Bo
2012-07-31 21:16   ` Goffredo Baroncelli
2012-08-01 11:28     ` Liu Bo [this message]
2012-08-02  9:52   ` Anand Jain

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=501912FA.2010200@gmail.com \
    --to=liub.liubo@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=kreijack@libero.it \
    --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).