From patchwork Wed Nov 3 11:04:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Reifschneider X-Patchwork-Id: 298862 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA3BDJ5O030469 for ; Wed, 3 Nov 2010 11:13:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754773Ab0KCLNP (ORCPT ); Wed, 3 Nov 2010 07:13:15 -0400 Received: from mail.tummy.com ([198.49.126.6]:41136 "EHLO mail2.tummy.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754257Ab0KCLNO (ORCPT ); Wed, 3 Nov 2010 07:13:14 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 03 Nov 2010 11:13:20 +0000 (UTC) X-Greylist: delayed 472 seconds by postgrey-1.27 at vger.kernel.org; Wed, 03 Nov 2010 07:13:14 EDT Received: by mail2.tummy.com (Postfix, from userid 10) id 452CC1BAD1A; Wed, 3 Nov 2010 05:05:20 -0600 (MDT) Received: from guin.tummy.com (localhost.localdomain [127.0.0.1]) by guin.tummy.com (Postfix) with ESMTP id F081D1141A0 for ; Wed, 3 Nov 2010 05:05:03 -0600 (MDT) Message-ID: <4CD141DA.8050709@tummy.com> Date: Wed, 03 Nov 2010 05:04:58 -0600 From: Sean Reifschneider Organization: tummy.com, ltd. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.6 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org Subject: Re: Patch to provide "btrfs subvolume last-gen". X-Enigmail-Version: 1.1.2 X-Hashcash: 1:26:101103:linux-btrfs@vger.kernel.org::A/ipoC0U1q87R4N2:0000000000 000000000000000000000002rZVR Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/btrfs_cmds.c b/btrfs_cmds.c index 25eafb8..9439457 100644 --- a/btrfs_cmds.c +++ b/btrfs_cmds.c @@ -272,7 +272,7 @@ int do_get_latest_gen(int argc, char **argv) return 12; } max_found = find_root_gen(fd); - printf("transid marker was %llu\n", (unsigned long long)max_found); + printf("%llu\n", (unsigned long long)max_found); return 0; } diff --git a/man/btrfs.8.in b/man/btrfs.8.in index 26ef982..23ba7d2 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@ -15,6 +15,10 @@ btrfs \- control a btrfs filesystem .PP \fBbtrfs\fP \fBsubvolume set-default\fP\fI \fP .PP +\fBbtrfs\fP \fBsubvolume last-gen\fP\fI \fP +.PP +\fBbtrfs\fP \fBsubvolume find-new\fP\fI \fP +.PP \fBbtrfs\fP \fBfilesystem defrag\fP\fI | [|...]\fP .PP \fBbtrfs\fP \fBfilesystem sync\fP\fI \fP @@ -96,6 +100,21 @@ These may be used by the \fBsubvolume set-default\fR command, or at mount time via the \fIsubvol=\fR option. .TP +\fBsubvolume last-gen\fR\fI \fR +Return the most current generation id of \fI\fR. This number is +suitable for use with the \fBsubvolume find-new\fR command, for example. +A single number is sent to stdout, representing the most recent generation +within a subvolume/snapshot. + +\fBsubvolume find-new\fR\fI \fR +Display changes to the subvolume \fI\fR since the generation id +\fI\fR. The resulting information includes filenames, offset +within the file, length, and more. The last line output displays the most +recent generation id represented by the output. For example, one could +feed this id back in to get an ongoing report of changes to the +subvolume. +.TP + \fBsubvolume set-default\fR\fI \fR Set the subvolume of the filesystem \fI\fR which is mounted as \fIdefault\fR. The subvolume is identified by \fB\fR, which