]> 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)
committerD Brashear <shadow@your-file-system.com>
Mon, 25 Aug 2014 19:50:49 +0000 (15:50 -0400)
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.

Change-Id: I18206d25f056e553eed2f3c3e0695fed003f3714
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>
src/volser/dumpstuff.c
src/volser/vol-dump.c

index 03239224c2e587e801b2ba9b4befcc6c0b147ca4..bc1fe9fea8fbe32a3f975e4f4a0cd3954f0aadde 100644 (file)
@@ -1037,7 +1037,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 f0559523ffd9c98c3194e26a10391afc29ea5de1..9de1780d13b660187e94ccf1c07a8fca3b53fbbf 100644 (file)
@@ -375,7 +375,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);