diff mbox

Patch to provide "btrfs subvolume last-gen".

Message ID 4CD141DA.8050709@tummy.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Reifschneider Nov. 3, 2010, 11:04 a.m. UTC
None
diff mbox

Patch

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