linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Reifschneider <jafo@tummy.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Patch to provide "btrfs subvolume last-gen".
Date: Wed, 03 Nov 2010 05:04:58 -0600	[thread overview]
Message-ID: <4CD141DA.8050709@tummy.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 523 bytes --]

Thanks for the feedback Goffredo.  I've given it some thought and in the
spirit of "small programs cooperating", it seems like just having it write
out the generation id without the surrounding text makes sense.  The text
I pulled from the find-new sub-command, where it makes sense (to
differentiate it from the other changes).

The patch here makes that change and also adds the man page entries for
last-gen and find-new (since last-gen refers to it, but there isn't any
documentation for it).

Thanks,
Sean

[-- Attachment #1.2: 0002-Updating-man-page-and-removing-transid-text.patch --]
[-- Type: text/plain, Size: 2319 bytes --]

From 17459dcc8cc9d54963cbfd844006340315b73e86 Mon Sep 17 00:00:00 2001
From: Sean Reifschneider <jafo@tummy.com>
Date: Wed, 3 Nov 2010 04:59:20 -0600
Subject: [PATCH 2/2] Updating man page and removing transid text.

---
 btrfs_cmds.c   |    2 +-
 man/btrfs.8.in |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)

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 <id> <path>\fP
 .PP
+\fBbtrfs\fP \fBsubvolume last-gen\fP\fI <path>\fP
+.PP
+\fBbtrfs\fP \fBsubvolume find-new\fP\fI <path> <last_gen>\fP
+.PP
 \fBbtrfs\fP \fBfilesystem defrag\fP\fI <file>|<dir> [<file>|<dir>...]\fP
 .PP
 \fBbtrfs\fP \fBfilesystem sync\fP\fI <path> \fP
@@ -96,6 +100,21 @@ These <ID> 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 <path>\fR
+Return the most current generation id of \fI<path>\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 <path> <last_gen>\fR
+Display changes to the subvolume \fI<path>\fR since the generation id
+\fI<last_gen>\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 <id> <path>\fR
 Set the subvolume of the filesystem \fI<path>\fR which is mounted as 
 \fIdefault\fR. The subvolume is identified by \fB<id>\fR, which 
-- 
1.7.3.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 253 bytes --]

             reply	other threads:[~2010-11-03 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03 11:04 Sean Reifschneider [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-11-03  9:23 Patch to provide "btrfs subvolume last-gen" Sean Reifschneider

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=4CD141DA.8050709@tummy.com \
    --to=jafo@tummy.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).