]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
use V_copyDate in DumpHeader for cloned volumes
authorHans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Thu, 14 Aug 2014 09:56:22 +0000 (11:56 +0200)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 5 Nov 2015 09:53:47 +0000 (04:53 -0500)
Volume dumps can be created from backup volumes, cloned volumes, or
directly from RW volumes. The beginning and end of the time range
covered by the dump is recorded in the DumpHeader. The end time is
based on the type of the volume. Use backupDate for backup volumes,
use copyDate for cloned volumes, and updateDate for RW volumes.

Reviewed-on: http://gerrit.openafs.org/11389
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 1e6fb1b7b7ed32e2035452db9fc221f38a8b4956)

Change-Id: I7372a1f46b96c4c42fb45b71f0d71017216f3830
Reviewed-on: http://gerrit.openafs.org/11433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@mpa-garching.mpg.de>
Reviewed-by: Daria Phoebe Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/volser/dumpstuff.c
src/volser/vol-dump.c

index 23c799efdda63c762e1ae56ac602e281e9f3e5f1..e1898da80c629e6cd23266de05b2b473b6208308 100644 (file)
@@ -1040,7 +1040,19 @@ DumpDumpHeader(struct iod *iodp, Volume * vp,
     if (!code)
        code = DumpString(iodp, 'n', V_name(vp));
     dumpTimes[0] = fromtime;
-    dumpTimes[1] = V_backupDate(vp);   /* Until the time the clone was made */
+    switch (V_type(vp)) {
+    case readwriteVolume:
+       dumpTimes[1] = V_updateDate(vp);        /* until last update */
+       break;
+    case readonlyVolume:
+       dumpTimes[1] = V_copyDate(vp);          /* until clone was made */
+       break;
+    case backupVolume:
+       dumpTimes[1] = V_backupDate(vp);        /* until backup was made */
+       break;
+    default:
+       code = EINVAL;
+    }
     if (!code)
        code = DumpArrayInt32(iodp, 't', (afs_uint32 *) dumpTimes, 2);
     return code;
index 912f0b417fd6da8ec251f022bdddd7950d82dfa8..3e20d8c2ef9a3e219207d76edaf82d9c81516afe 100644 (file)
@@ -410,7 +410,19 @@ DumpDumpHeader(int dumpfd, Volume * vp, afs_int32 fromtime)
        code = DumpString(dumpfd, 'n', V_name(vp));
 
     dumpTimes[0] = fromtime;
-    dumpTimes[1] = V_backupDate(vp);   /* Until the time the clone was made */
+    switch (V_type(vp)) {
+    case readwriteVolume:
+       dumpTimes[1] = V_updateDate(vp);        /* until last update */
+       break;
+    case readonlyVolume:
+       dumpTimes[1] = V_copyDate(vp);          /* until clone was made */
+       break;
+    case backupVolume:
+       dumpTimes[1] = V_backupDate(vp);        /* until backup was made */
+       break;
+    default:
+       code = EINVAL;
+    }
     if (!code)
        code = DumpArrayInt32(dumpfd, 't', (afs_uint32 *) dumpTimes, 2);