socsvn commit: r329236 - soc2017/kneitinger/libbe-head/lib/libbe

allanjude at FreeBSD.org allanjude at FreeBSD.org
Thu Nov 9 15:53:25 UTC 2017


Author: allanjude
Date: Thu Nov  9 15:53:24 2017
New Revision: 329236
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=329236

Log:
  Extend the API to allow snapshots to be created recursively

Modified:
  soc2017/kneitinger/libbe-head/lib/libbe/be.c
  soc2017/kneitinger/libbe-head/lib/libbe/be.h

Modified: soc2017/kneitinger/libbe-head/lib/libbe/be.c
==============================================================================
--- soc2017/kneitinger/libbe-head/lib/libbe/be.c	Thu Nov  9 15:48:35 2017	(r329235)
+++ soc2017/kneitinger/libbe-head/lib/libbe/be.c	Thu Nov  9 15:53:24 2017	(r329236)
@@ -186,7 +186,8 @@
 
 
 int
-be_snapshot(libbe_handle_t *lbh, char *source, char *snap_name, char *result)
+be_snapshot(libbe_handle_t *lbh, char *source, char *snap_name,
+    bool recursive, char *result)
 {
 	char buf[BE_MAXPATHLEN];
 	time_t rawtime;
@@ -215,7 +216,7 @@
 		}
 	}
 
-	if (err = zfs_snapshot(lbh->lzh, buf, false, NULL) != 0) {
+	if (err = zfs_snapshot(lbh->lzh, buf, recursive, NULL) != 0) {
 		switch (err) {
 		case EZFS_INVALIDNAME:
 			return (set_error(lbh, BE_ERR_INVALIDNAME));
@@ -580,7 +581,7 @@
 	zfs_handle_t *zfs;
 	int err;
 
-	if (err = be_snapshot(lbh, bootenv, NULL, snap_name)) {
+	if (err = be_snapshot(lbh, bootenv, NULL, true, snap_name)) {
 		// TODO error handle
 		return (-1);
 	}

Modified: soc2017/kneitinger/libbe-head/lib/libbe/be.h
==============================================================================
--- soc2017/kneitinger/libbe-head/lib/libbe/be.h	Thu Nov  9 15:48:35 2017	(r329235)
+++ soc2017/kneitinger/libbe-head/lib/libbe/be.h	Thu Nov  9 15:53:24 2017	(r329236)
@@ -71,7 +71,7 @@
 int be_create(libbe_handle_t *, char *);
 int be_create_from_existing(libbe_handle_t *, char *, char *);
 int be_create_from_existing_snap(libbe_handle_t *, char *, char *);
-int be_snapshot(libbe_handle_t *, char *, char *, char *);
+int be_snapshot(libbe_handle_t *, char *, char *, bool, char *);
 
 /* Bootenv manipulation functions */
 int be_rename(libbe_handle_t *, char *, char *);


More information about the svn-soc-all mailing list