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/afsint.h>
19 #include <afs/volser.h>
22 #include <afs/volint.h>
23 #include <afs/volser.h>
24 #include <afs/volser_prototypes.h>
25 #include <afs/com_err.h>
29 /* ********************************************************************* */
30 /* Volserver routines */
31 /* ********************************************************************* */
34 bc_GetEntryByID(struct ubik_client
*uclient
, afs_int32 volID
,
35 afs_int32 volType
, struct vldbentry
*vldbEntryPtr
)
40 ubik_VL_GetEntryByID(uclient
, 0, volID
, volType
, vldbEntryPtr
);
45 * Determine the time stamp to be recorded with the backup of this
46 * volume. For backup and r/o volumes this is the clone time, for
47 * r/w volumes, this is the current time. This timestamp is stored
48 * directly into the cloneDate field of the bc_volumeDump structure
51 * -1 - failed to get information. Sets cloneDate to 0.
55 volImageTime(afs_uint32 serv
, afs_int32 part
, afs_uint32 volid
,
56 afs_int32 voltype
, afs_int32
*clDatePtr
)
59 struct volintInfo
*viptr
;
61 if (voltype
== RWVOL
) {
66 code
= UV_ListOneVolume(htonl(serv
), part
, volid
, &viptr
);
68 afs_com_err(whoami
, code
,
69 "Warning: Can't get clone time of volume %u - using 0",
75 /* volume types from vol/voldefs.h */
76 switch (viptr
->type
) {
78 /* For a r/w volume there may not be any foolproof way of
79 * preventing anomalies in the backups. Use the current time;
86 *clDatePtr
= viptr
->creationDate
; /* use the creation time */
90 afs_com_err(whoami
, 0,
91 "Can't get clone time of volume %u - unknown volume type",