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>
14 #include <sys/types.h>
18 #include <sys/socket.h>
19 #include <netinet/in.h>
23 #include <afs/vlserver.h> /*Misc server-side Volume Location stuff */
27 #include <afs/volint.h>
28 #include <afs/volser.h>
29 #include <afs/volser_prototypes.h>
30 #include <afs/com_err.h>
34 /* ********************************************************************* */
35 /* Volserver routines */
36 /* ********************************************************************* */
39 bc_GetEntryByID(struct ubik_client *uclient, afs_int32 volID,
40 afs_int32 volType, struct vldbentry *vldbEntryPtr)
45 ubik_VL_GetEntryByID(uclient, 0, volID, volType, vldbEntryPtr);
50 * Determine the time stamp to be recorded with the backup of this
51 * volume. For backup and r/o volumes this is the clone time, for
52 * r/w volumes, this is the current time. This timestamp is stored
53 * directly into the cloneDate field of the bc_volumeDump structure
56 * -1 - failed to get information. Sets cloneDate to 0.
60 volImageTime(afs_int32 serv, afs_int32 part, afs_int32 volid,
61 afs_int32 voltype, afs_int32 *clDatePtr)
64 struct volintInfo *viptr;
66 if (voltype == RWVOL) {
71 code = UV_ListOneVolume(htonl(serv), part, volid, &viptr);
73 afs_com_err(whoami, code,
74 "Warning: Can't get clone time of volume %u - using 0",
80 /* volume types from vol/voldefs.h */
81 switch (viptr->type) {
83 /* For a r/w volume there may not be any foolproof way of
84 * preventing anomalies in the backups. Use the current time;
91 *clDatePtr = viptr->creationDate; /* use the creation time */
95 afs_com_err(whoami, 0,
96 "Can't get clone time of volume %u - unknown volume type",