2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
16 #include <afs/vlserver.h> /*Misc server-side Volume Location stuff */
18 #include <afs/volser.h>
21 #include <afs/volint.h>
22 #include <afs/volser.h>
23 #include <afs/volser_prototypes.h>
24 #include <afs/com_err.h>
28 /* ********************************************************************* */
29 /* Volserver routines */
30 /* ********************************************************************* */
33 bc_GetEntryByID(struct ubik_client *uclient, afs_int32 volID,
34 afs_int32 volType, struct vldbentry *vldbEntryPtr)
39 ubik_VL_GetEntryByID(uclient, 0, volID, volType, vldbEntryPtr);
44 * Determine the time stamp to be recorded with the backup of this
45 * volume. For backup and r/o volumes this is the clone time, for
46 * r/w volumes, this is the current time. This timestamp is stored
47 * directly into the cloneDate field of the bc_volumeDump structure
50 * -1 - failed to get information. Sets cloneDate to 0.
54 volImageTime(afs_uint32 serv, afs_int32 part, afs_uint32 volid,
55 afs_int32 voltype, afs_int32 *clDatePtr)
58 struct volintInfo *viptr;
60 if (voltype == RWVOL) {
65 code = UV_ListOneVolume(htonl(serv), part, volid, &viptr);
67 afs_com_err(whoami, code,
68 "Warning: Can't get clone time of volume %u - using 0",
74 /* volume types from vol/voldefs.h */
75 switch (viptr->type) {
77 /* For a r/w volume there may not be any foolproof way of
78 * preventing anomalies in the backups. Use the current time;
85 *clDatePtr = viptr->creationDate; /* use the creation time */
89 afs_com_err(whoami, 0,
90 "Can't get clone time of volume %u - unknown volume type",