#include <afs\afs_vosAdmin.h>
#include <afs\afs_bosAdmin.h>
#include <afs\afs_clientAdmin.h>
+#include <afs\afsint.h>
#include <afs\volser.h>
#include <afs\dirpath.h>
#include <WINNT\afsreg.h>
#include <ubik.h>
#include <afs/ktime.h>
#include <afs/kautils.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
static int IStatServer(struct cmd_syndesc *as, int int32p);
#include <afs/budb_prototypes.h>
#include <afs/butc.h>
#include <afs/bubasics.h> /* PA */
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/voldefs.h> /* PA */
#include <afs/vldbint.h> /* PA */
#include <afs/afsutil.h>
#include <afs/budb.h>
#include <afs/bubasics.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include "bc.h"
#include <ubik.h>
#include <afs/cmd.h>
#include <rx/rxkad.h>
+#include <afs/afsint.h>
#include <afs/volser.h> /*VLDB_MAXSERVERS */
#include <afs/com_err.h>
#include <lock.h>
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <ubik.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/volser_prototypes.h>
#include <afs/afsutil.h>
#include <rx/xdr.h>
#include <afs/vlserver.h> /*Misc server-side Volume Location stuff */
#include <ubik.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include "bc.h"
#include <afs/tcdata.h>
#include <afs/bubasics.h>
#include <afs/budb_client.h>
+#include <afs/afsint.h>
#include <afs/vldbint.h>
#include <afs/vlserver.h>
#include <afs/volser.h>
#include <afs/vldbint.h>
#include <afs/ktime.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/volser_prototypes.h>
#include <afs/volint.h>
#include <afs/budb_client.h>
#include <afs/bucoord_prototypes.h>
#include <afs/butm_prototypes.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/volser_prototypes.h>
#include <afs/com_err.h>
# define AFS_SIZET_FMT "lu"
# endif /* PRINTF_TAKES_Z_LEN */
#endif /* AFS_NT40_ENV */
+#define AFS_VOLID_FMT "lu"
/* Functions to safely cast afs_int32 and afs_uint32 so they can be used in
* printf statemements with %ld and %lu
#include <afs/vlserver.h>
#include <afs/pterror.h>
#include <afs/bnode.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <ubik.h>
#include <afs/vlserver.h>
#include <afs/pterror.h>
#include <afs/bnode.h>
-#include <afs/volser.h>
#include <afs/afscbint.h>
+#include <afs/volser.h>
#include "afs_AdminInternal.h"
#include "afs_utilAdmin.h"
#include <ctype.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/volint.h>
#include <afs/com_err.h>
#include <afs/cellconfig.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <rx/rxkad.h>
#include <afs/com_err.h>
#include <afs/cellconfig.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <rx/rxkad.h>
#include <afs/vlserver.h>
#include <afs/cellconfig.h>
#include <rx/rxkad.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <ubik.h>
} else if (iflag)
for (i = 0; i < numentries; i++)
if (!(lvdata = GetVnode(ntohl(eplist[i]->fid.vnode))))
- printf("%d.0.0\t%s\n",
- vol->parentId ? vol->parentId : vol->id,
+ printf("%" AFS_VOLID_FMT ".0.0\t%s\n",
+ vol->parentId ? afs_printable_VolumeId_lu(vol->parentId)
+ : afs_printable_VolumeId_lu(vol->id),
eplist[i]->name);
else if (path)
- printf("%d.%d.%d\t%s/%s\n", vol->id,
+ printf("%" AFS_VOLID_FMT ".%d.%d\t%s/%s\n",
+ afs_printable_VolumeId_lu(vol->id),
ntohl(eplist[i]->fid.vnode),
ntohl(eplist[i]->fid.vunique), path, eplist[i]->name);
else
- printf("%d.%d.%d\t%s\n", vol->id, ntohl(eplist[i]->fid.vnode),
+ printf("%" AFS_VOLID_FMT ".%d.%d\t%s\n",
+ afs_printable_VolumeId_lu(vol->id),
+ ntohl(eplist[i]->fid.vnode),
ntohl(eplist[i]->fid.vunique), eplist[i]->name);
else if (lflag) {
for (i = 0; i < numentries; i++)
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include <afs/volser.h>
#include <afs/volint.h>
fdP = IH_OPEN(vnp->handle);
if (fdP == NULL) {
- ViceLog(0, ("CheckLength: cannot open inode for fid %lu.%lu.%lu\n",
- afs_printable_uint32_lu(vp->hashid),
+ ViceLog(0, ("CheckLength: cannot open inode for fid %" AFS_VOLID_FMT ".%lu.%lu\n",
+ afs_printable_VolumeId_lu(vp->hashid),
afs_printable_uint32_lu(Vn_id(vnp)),
afs_printable_uint32_lu(vnp->disk.uniquifier)));
return -1;
FDH_CLOSE(fdP);
if (alen < 0) {
afs_int64 alen64 = alen;
- ViceLog(0, ("CheckLength: cannot get size for inode for fid "
- "%lu.%lu.%lu; FDH_SIZE returned %" AFS_INT64_FMT "\n",
- afs_printable_uint32_lu(vp->hashid),
+ ViceLog(0, ("CheckLength: cannot get size for inode for fid %"
+ AFS_VOLID_FMT ".%lu.%lu; FDH_SIZE returned %" AFS_INT64_FMT "\n",
+ afs_printable_VolumeId_lu(vp->hashid),
afs_printable_uint32_lu(Vn_id(vnp)),
afs_printable_uint32_lu(vnp->disk.uniquifier),
alen64));
if (alen != vlen) {
afs_int64 alen64 = alen, vlen64 = vlen;
- ViceLog(0, ("Fid %lu.%lu.%lu has inconsistent length (index "
+ ViceLog(0, ("Fid %" AFS_VOLID_FMT ".%lu.%lu has inconsistent length (index "
"%lld inode %lld ); volume must be salvaged\n",
- afs_printable_uint32_lu(vp->hashid),
+ afs_printable_VolumeId_lu(vp->hashid),
afs_printable_uint32_lu(Vn_id(vnp)),
afs_printable_uint32_lu(vnp->disk.uniquifier),
vlen64, alen64));
if (!VALID_INO(ino)) {
free(buff);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
targFdP = IH_OPEN(targetptr->handle);
if (targFdP == NULL) {
rc = errno;
ViceLog(0,
- ("CopyOnWrite failed: Failed to open target vnode %u in volume %u (errno = %d)\n",
- targetptr->vnodeNumber, V_id(volptr), rc));
+ ("CopyOnWrite failed: Failed to open target vnode %u in volume %" AFS_VOLID_FMT " (errno = %d)\n",
+ targetptr->vnodeNumber, afs_printable_VolumeId_lu(V_id(volptr)), rc));
free(buff);
VTakeOffline(volptr);
return rc;
(int)targetptr->disk.dataVersion);
if (!VALID_INO(ino)) {
ViceLog(0,
- ("CopyOnWrite failed: Partition %s that contains volume %u may be out of free inodes(errno = %d)\n",
- volptr->partition->name, V_id(volptr), errno));
+ ("CopyOnWrite failed: Partition %s that contains volume %" AFS_VOLID_FMT " may be out of free inodes(errno = %d)\n",
+ volptr->partition->name, afs_printable_VolumeId_lu(V_id(volptr)), errno));
FDH_CLOSE(targFdP);
free(buff);
return ENOSPC;
if ((rdlen != length) || (wrlen != length)) {
if ((wrlen < 0) && (errno == ENOSPC)) { /* disk full */
ViceLog(0,
- ("CopyOnWrite failed: Partition %s containing volume %u is full\n",
- volptr->partition->name, V_id(volptr)));
+ ("CopyOnWrite failed: Partition %s containing volume %" AFS_VOLID_FMT " is full\n",
+ volptr->partition->name, afs_printable_VolumeId_lu(V_id(volptr))));
/* remove destination inode which was partially copied till now */
FDH_REALLYCLOSE(newFdP);
IH_RELEASE(newH);
rc = IH_DEC(V_linkHandle(volptr), ino, V_parentId(volptr));
if (rc) {
ViceLog(0,
- ("CopyOnWrite failed: error %u after i_dec on disk full, volume %u in partition %s needs salvage\n",
- rc, V_id(volptr), volptr->partition->name));
+ ("CopyOnWrite failed: error %u after i_dec on disk full, volume %" AFS_VOLID_FMT " in partition %s needs salvage\n",
+ rc, afs_printable_VolumeId_lu(V_id(volptr)), volptr->partition->name));
VTakeOffline(volptr);
}
free(buff);
* time, just case to an unsigned int for printing */
ViceLog(0,
- ("CopyOnWrite failed: volume %u in partition %s (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n",
- V_id(volptr), volptr->partition->name, (unsigned)length, (unsigned)rdlen,
+ ("CopyOnWrite failed: volume %" AFS_VOLID_FMT " in partition %s (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n",
+ afs_printable_VolumeId_lu(V_id(volptr)), volptr->partition->name, (unsigned)length, (unsigned)rdlen,
(unsigned)wrlen, errno));
#if defined(AFS_DEMAND_ATTACH_FS)
ViceLog(0, ("CopyOnWrite failed: requesting salvage\n"));
if ((*targetptr)->disk.uniquifier != fileFid->Unique) {
VTakeOffline(volptr);
ViceLog(0,
- ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
errorCode = VSALVAGE;
return errorCode;
}
{
VTakeOffline(volptr);
ViceLog(0,
- ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return (EIO);
}
DT1++;
Directory) ? "directory" : "file")));
VTakeOffline(volptr);
ViceLog(0,
- ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
if (!errorCode)
errorCode = code;
}
VAdjustDiskUsage(&nc, volptr, -length, 0);
if (rc == VOVERQUOTA) {
ViceLog(2,
- ("Volume %u (%s) is full\n", V_id(volptr),
+ ("Volume %" AFS_VOLID_FMT " (%s) is full\n",
+ afs_printable_VolumeId_lu(V_id(volptr)),
V_name(volptr)));
return (rc);
}
if (rc == VDISKFULL) {
ViceLog(0,
- ("Partition %s that contains volume %u is full\n",
- volptr->partition->name, V_id(volptr)));
+ ("Partition %s that contains volume %" AFS_VOLID_FMT " is full\n",
+ volptr->partition->name,
+ afs_printable_VolumeId_lu(V_id(volptr))));
return (rc);
}
ViceLog(0, ("Got error return %d from VAdjustDiskUsage\n", rc));
/* error in creating inode */
if (!VALID_INO(inode)) {
ViceLog(0,
- ("Volume : %u vnode = %u Failed to create inode: errno = %d\n",
- V_id((*targetptr)->volumePtr),
+ ("Volume : %" AFS_VOLID_FMT " vnode = %u Failed to create inode: errno = %d\n",
+ afs_printable_VolumeId_lu(V_id((*targetptr)->volumePtr)),
(*targetptr)->vnodeNumber, errno));
VAdjustDiskUsage(&temp, volptr, -BlocksPreallocatedForVnode, 0);
(*targetptr)->delete = 1; /* delete vnode */
if ((top == 1) && (testnode != 0)) {
VTakeOffline(volptr);
ViceLog(0,
- ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
errorCode = EIO;
goto Bad_Rename;
}
(void)PutVolumePackage(acall, parentwhentargetnotdir, targetptr,
parentptr, volptr, &client);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
len = strlen((char *) LinkContents);
fdP = IH_OPEN(ihP);
if (fdP == NULL) {
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
optSize = sendBufSize;
if (tlen < 0) {
FDH_CLOSE(fdP);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
if (CheckLength(volptr, targetptr, tlen)) {
FDH_CLOSE(fdP);
FreeSendBuffer((struct afs_buffer *)tbuffer);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
nBytes = rx_Write(Call, tbuffer, wlen);
if (nBytes != wlen) {
FDH_CLOSE(fdP);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
nBytes = rx_Writev(Call, tiov, tnio, wlen);
if (GetLinkCountAndSize(volptr, fdP, &linkCount, &DataLength) < 0) {
FDH_CLOSE(fdP);
VTakeOffline(volptr);
- ViceLog(0, ("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0, ("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
if (CheckLength(volptr, targetptr, DataLength)) {
}
if (!VALID_INO(tinode)) {
VTakeOffline(volptr);
- ViceLog(0,("Volume %u now offline, must be salvaged.\n",
- volptr->hashid));
+ ViceLog(0,("Volume %" AFS_VOLID_FMT " now offline, must be salvaged.\n",
+ afs_printable_VolumeId_lu(volptr->hashid)));
return EIO;
}
#include <afs/afscbint.h>
#include <afs/afsutil.h>
#include <afs/ihandle.h>
+#include <afs/partition.h>
+#include <afs/vnode.h>
+#include <afs/volume.h>
#include "viced_prototypes.h"
#include "viced.h"
extern pthread_cond_t fsync_cond;
int
-BreakVolumeCallBacksLater(afs_uint32 volume)
+BreakVolumeCallBacksLater(VolumeId volume)
{
int hash;
afs_uint32 *feip;
struct host *host;
int found = 0;
- ViceLog(25, ("Setting later on volume %u\n", volume));
+ ViceLog(25, ("Setting later on volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(volume)));
H_LOCK;
for (hash = 0; hash < FEHASH_SIZE; hash++) {
for (feip = &HashTable[hash]; (fe = itofe(*feip)) != NULL; ) {
/* Ugly, but used to avoid left side casting */
struct object *tmpfe;
ViceLog(125,
- ("Unchaining for %u:%u:%u\n", fe->vnode, fe->unique,
- fe->volid));
+ ("Unchaining for %u:%u:%" AFS_VOLID_FMT "\n", fe->vnode,
+ fe->unique, afs_printable_VolumeId_lu(fe->volid)));
fid.Volume = fe->volid;
*feip = fe->fnext;
fe->status &= ~FE_LATER; /* not strictly needed */
/* leave flag for MultiBreakVolumeCallBack to clear */
} else {
ViceLog(125,
- ("Found host %p (%s:%d) non-DELAYED cb for %u:%u:%u\n",
+ ("Found host %p (%s:%d) non-DELAYED cb for %u:%u:%" AFS_VOLID_FMT "\n",
host, afs_inet_ntoa_r(host->host, hoststr),
- ntohs(host->port), fe->vnode, fe->unique, fe->volid));
+ ntohs(host->port), fe->vnode, fe->unique,
+ afs_printable_VolumeId_lu(fe->volid)));
}
}
myfe = fe;
cb = itocb(cbi);
cbi = cb->tnext;
ViceLog(8,
- ("CCB: deleting timed out call back %x (%s:%d), (%u,%u,%u)\n",
+ ("CCB: deleting timed out call back %x (%s:%d), (%" AFS_VOLID_FMT ",%u,%u)\n",
h_itoh(cb->hhead)->host,
afs_inet_ntoa_r(h_itoh(cb->hhead)->host, hoststr),
- h_itoh(cb->hhead)->port, itofe(cb->fhead)->volid,
+ h_itoh(cb->hhead)->port,
+ afs_printable_VolumeId_lu(itofe(cb->fhead)->volid),
itofe(cb->fhead)->vnode, itofe(cb->fhead)->unique));
HDel(cb);
CDel(cb, 1);
if (fe == NULL)
return;
- printf("vol=%u vn=%u cbs=%d hi=%d st=%d fest=%d, exp in %lu secs at %s",
- fe->volid, fe->vnode, fe->ncbs, cb->hhead, cb->status, fe->status,
- expires - now, ctime(&expires));
+ printf("vol=%" AFS_VOLID_FMT " vn=%u cbs=%d hi=%d st=%d fest=%d, exp in %lu secs at %s",
+ afs_printable_VolumeId_lu(fe->volid), fe->vnode, fe->ncbs,
+ cb->hhead, cb->status, fe->status, expires - now, ctime(&expires));
}
#endif
struct FileEntry {
afs_uint32 vnode;
afs_uint32 unique;
- afs_uint32 volid;
+ VolumeId volid;
afs_uint32 fnext; /* index of next FE in hash chain */
afs_uint32 ncbs; /* number of callbacks for this FE */
afs_uint32 firstcb; /* index of first cb in per-FE list */
/* arguments for PerHost_EnumerateClient enumeration */
struct enumclient_args {
- afs_int32 vid;
+ VolumeId vid;
int (*proc)(struct client *client, void *rock);
void *rock;
};
}
void
-h_EnumerateClients(afs_int32 vid,
+h_EnumerateClients(VolumeId vid,
int (*proc)(struct client *client, void *rock),
void *rock)
{
extern struct client *h_FindClient_r(struct rx_connection *tcon);
extern int h_ReleaseClient_r(struct client *client);
extern void h_TossStuff_r(struct host *host);
-extern void h_EnumerateClients(afs_int32 vid,
+extern void h_EnumerateClients(VolumeId vid,
int (*proc)(struct client *client, void *rock),
void *arock);
extern int GetClient(struct rx_connection *tcon, struct client **cp);
if (fdP == NULL) {
code = errno;
ViceLog(0,
- ("ReallyRead(): open failed device %X inode %s (volume=%u) errno %d\n",
+ ("ReallyRead(): open failed device %X inode %s (volume=%" AFS_VOLID_FMT ") errno %d\n",
file->dirh_handle->ih_dev, PrintInode(stmp,
file->dirh_handle->
- ih_ino), file->dirh_handle->ih_vid,code));
+ ih_ino),
+ afs_printable_VolumeId_lu(file->dirh_handle->ih_vid), code));
return code;
}
rdlen = FDH_PREAD(fdP, data, PAGESIZE, ((afs_foff_t)block) * PAGESIZE);
else
code = EIO;
ViceLog(0,
- ("ReallyRead(): read failed device %X inode %s (volume=%u) errno %d\n",
+ ("ReallyRead(): read failed device %X inode %s (volume=%" AFS_VOLID_FMT ") errno %d\n",
file->dirh_handle->ih_dev, PrintInode(stmp,
file->dirh_handle->
- ih_ino), file->dirh_handle->ih_vid,code));
+ ih_ino),
+ afs_printable_VolumeId_lu(file->dirh_handle->ih_vid), code));
FDH_REALLYCLOSE(fdP);
return code;
}
fdP = IH_OPEN(file->dirh_handle);
if (fdP == NULL) {
ViceLog(0,
- ("ReallyWrite(): open failed device %X inode %s (volume=%u) errno %d\n",
+ ("ReallyWrite(): open failed device %X inode %s (volume=%" AFS_VOLID_FMT ") errno %d\n",
file->dirh_handle->ih_dev, PrintInode(stmp,
file->dirh_handle->
- ih_ino), file->dirh_handle->ih_vid,errno));
+ ih_ino),
+ afs_printable_VolumeId_lu(file->dirh_handle->ih_vid), errno));
lpErrno = errno;
return 0;
}
if ((count = FDH_PWRITE(fdP, data, PAGESIZE, ((afs_foff_t)block) * PAGESIZE)) != PAGESIZE) {
ViceLog(0,
- ("ReallyWrite(): write failed device %X inode %s (volume=%u) errno %d\n",
+ ("ReallyWrite(): write failed device %X inode %s (volume=%" AFS_VOLID_FMT ") errno %d\n",
file->dirh_handle->ih_dev, PrintInode(stmp,
file->dirh_handle->
- ih_ino), file->dirh_handle->ih_vid,errno));
+ ih_ino),
+ afs_printable_VolumeId_lu(file->dirh_handle->ih_vid), errno));
lpCount = count;
lpErrno = errno;
FDH_REALLYCLOSE(fdP);
}
int
-FidVolEq(DirHandle * afile, afs_int32 vid)
+FidVolEq(DirHandle * afile, VolumeId vid)
{
if (afile->dirh_vid != vid)
return 0;
/* active volume entry */
struct AVDiskEntry {
- afs_uint32 volume;
+ VolumeId volume;
afs_uint32 partition;
afs_uint32 hash_next;
};
#include <afs/opr_assert.h>
#include <lwp.h>
#include <lock.h>
+#include <afs/opr.h>
+#include <rx/rx.h>
+#include <rx/rx_queue.h>
#include <afs/afsint.h>
#include <afs/rxgen_consts.h>
#include <afs/nfs.h>
#include <afs/errors.h>
#include <afs/ihandle.h>
+#include <afs/partition.h>
+#include <afs/vnode.h>
+#include <afs/volume.h>
#include <afs/acl.h>
#include <afs/ptclient.h>
#include <afs/prs_fs.h>
static int find_fe_by_index(afs_uint32 idx);
static int find_cb_by_index(afs_uint32 idx);
-static int find_fe_by_fid(afs_uint32 vol, afs_uint32 vn, afs_uint32 uniq);
+static int find_fe_by_fid(VolumeId vol, afs_uint32 vn, afs_uint32 uniq);
static int dump_fd = -1;
DPFSO1("fe");
DPFV2("vnode", "u", fe_cursor.fe.fe.vnode);
DPFV2("unique", "u", fe_cursor.fe.fe.unique);
- DPFV2("volid", "u", fe_cursor.fe.fe.volid);
+ DPFV2("volid", AFS_VOLID_FMT, afs_printable_VolumeId_lu(fe_cursor.fe.fe.volid));
DPFV2("fnext", "u", fe_cursor.fe.fe.fnext);
DPFV2("ncbs", "u", fe_cursor.fe.fe.ncbs);
DPFV2("firstcb", "u", fe_cursor.fe.fe.firstcb);
}
static int
-find_fe_by_fid(afs_uint32 volid, afs_uint32 vnode, afs_uint32 unique)
+find_fe_by_fid(VolumeId volid, afs_uint32 vnode, afs_uint32 unique)
{
int i;
/* callback.c */
extern int InitCallBack(int);
extern int BreakLaterCallBacks(void);
-extern int BreakVolumeCallBacksLater(afs_uint32);
+extern int BreakVolumeCallBacksLater(VolumeId);
#ifdef AFS_DEMAND_ATTACH_FS
/*
} else if (rwinode) {
if (IH_INC(V_linkHandle(rwvp), rwinode, V_parentId(rwvp)) ==
-1) {
- Log("IH_INC failed: %"AFS_PTR_FMT", %s, %u errno %d\n",
+ Log("IH_INC failed: %"AFS_PTR_FMT", %s, %" AFS_VOLID_FMT " errno %d\n",
V_linkHandle(rwvp), PrintInode(stmp, rwinode),
- V_parentId(rwvp), errno);
+ afs_printable_VolumeId_lu(V_parentId(rwvp)), errno);
VForceOffline(rwvp);
ERROR_EXIT(EIO);
}
if (inodeinced) {
if (IH_DEC(V_linkHandle(rwvp), rwinode, V_parentId(rwvp)) ==
-1) {
- Log("IH_DEC failed: %"AFS_PTR_FMT", %s, %u errno %d\n",
+ Log("IH_DEC failed: %"AFS_PTR_FMT", %s, %" AFS_VOLID_FMT " errno %d\n",
V_linkHandle(rwvp), PrintInode(stmp, rwinode),
- V_parentId(rwvp), errno);
+ afs_printable_VolumeId_lu(V_parentId(rwvp)), errno);
VForceOffline(rwvp);
ERROR_EXIT(EIO);
}
if (code)
ERROR_EXIT(code);
if (filecount != V_filecount(original) || diskused != V_diskused(original))
- Log("Clone %u: filecount %d -> %d diskused %d -> %d\n",
- V_id(original), filecount, V_filecount(original), diskused, V_diskused(original));
+ Log("Clone %" AFS_VOLID_FMT ": filecount %d -> %d diskused %d -> %d\n",
+ afs_printable_VolumeId_lu(V_id(original)), filecount,
+ V_filecount(original), diskused, V_diskused(original));
code = CopyVolumeHeader(&V_disk(original), &V_disk(new));
if (code)
struct volop_state {
- afs_uint32 volume;
+ VolumeId volume;
afs_uint32 vnode;
afs_uint32 unique;
char partName[16];
memcpy(&v, res.payload.buf, sizeof(Volume));
printf("volume = {\n");
- printf("\thashid = %u\n", v.hashid);
+ printf("\thashid = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.hashid));
printf("\theader = %p\n", v.header);
printf("\tdevice = %d\n", v.device);
printf("\tpartition = %p\n", v.partition);
printf("\t\tversion = %u\n", v.stamp.version);
printf("\t}\n");
- printf("\tid = %u\n", v.id);
+ printf("\tid = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.id));
printf("\tname = '%s'\n", v.name);
if (v.inUse != 0) {
printf("\tinUse = %d (%s)\n", v.inUse, VPTypeToString(v.inUse));
printf("\tneedsSalvaged = %d\n", v.needsSalvaged);
printf("\tuniquifier = %u\n", v.uniquifier);
printf("\ttype = %d\n", v.type);
- printf("\tparentId = %u\n", v.parentId);
- printf("\tcloneId = %u\n", v.cloneId);
- printf("\tbackupId = %u\n", v.backupId);
- printf("\trestoredFromId = %u\n", v.restoredFromId);
+ printf("\tparentId = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.parentId));
+ printf("\tcloneId = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.cloneId));
+ printf("\tbackupId = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.backupId));
+ printf("\trestoredFromId = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(v.restoredFromId));
printf("\tneedsCallback = %d\n", v.needsCallback);
printf("\tdestroyMe = %d\n", v.destroyMe);
printf("\tdontSalvage = %d\n", v.dontSalvage);
printf("\t}\n");
printf("\tvop = {\n");
- printf("\t\tvolume = %u\n", vop.vop.volume);
+ printf("\t\tvolume = %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(vop.vop.volume));
if (strnlen(vop.vop.partName, sizeof(vop.vop.partName)) <
sizeof(vop.vop.partName)) {
printf("\t\tpartName = '%s'\n", vop.vop.partName);
if (node->update_salv_prio) {
if (VUpdateSalvagePriority_r(vp)) {
ViceLog(0, ("FSYNC_salvageThread: unable to raise salvage priority "
- "for volume %lu\n", afs_printable_uint32_lu(vp->hashid)));
+ "for volume %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(vp->hashid)));
}
}
node->update_salv_prio = vp->salvage.requested;
if (VRequestSalvage_r(&ec, vp, SALVSYNC_ERROR, 0)) {
- ViceLog(0, ("FSYNC_backgroundSalvage: unable to request salvage for volume %lu\n",
- afs_printable_uint32_lu(vp->hashid)));
+ ViceLog(0, ("FSYNC_backgroundSalvage: unable to request salvage for volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(vp->hashid)));
}
queue_Append(&fsync_salv.head, node);
(vcom->hdr->programType != vp->pending_vol_op->com.programType)) {
/* a different program has this volume checked out. deny. */
Log("FSYNC_VolOn: WARNING: program type %u has attempted to manipulate "
- "state for volume %u using command code %u while the volume is "
+ "state for volume %" AFS_VOLID_FMT " using command code %u while the volume is "
"checked out by program type %u for command code %u.\n",
vcom->hdr->programType,
- vcom->vop->volume,
+ afs_printable_VolumeId_lu(vcom->vop->volume),
vcom->hdr->command,
vp->pending_vol_op->com.programType,
vp->pending_vol_op->com.command);
}
#else /* !AFS_DEMAND_ATTACH_FS */
tvolName[0] = OS_DIRSEPC;
- snprintf(&tvolName[1], sizeof(tvolName)-1, VFORMAT, afs_printable_uint32_lu(vcom->vop->volume));
+ snprintf(&tvolName[1], sizeof(tvolName)-1, VFORMAT, afs_printable_VolumeId_lu(vcom->vop->volume));
tvolName[sizeof(tvolName)-1] = '\0';
vp = VAttachVolumeByName_r(&error, vcom->vop->partName, tvolName,
if (vp->pending_vol_op->com.command == FSYNC_VOL_OFF &&
vp->pending_vol_op->com.reason == FSYNC_SALVAGE) {
- Log("denying offline request for volume %lu; volume is salvaging\n",
- afs_printable_uint32_lu(vp->hashid));
+ Log("denying offline request for volume %" AFS_VOLID_FMT "; volume is salvaging\n",
+ afs_printable_VolumeId_lu(vp->hashid));
res->hdr.reason = FSYNC_SALVAGE;
goto deny;
}
- Log("volume %u already checked out\n", vp->hashid);
+ Log("volume %" AFS_VOLID_FMT " already checked out\n",
+ afs_printable_VolumeId_lu(vp->hashid));
/* XXX debug */
- Log("vp->vop = { com = { ver=%u, prog=%d, com=%d, reason=%d, len=%u, flags=0x%x }, vop = { vol=%u, part='%s' } }\n",
+ Log("vp->vop = { com = { ver=%u, prog=%d, com=%d, reason=%d, len=%u, flags=0x%x }, vop = { vol=%" AFS_VOLID_FMT ", part='%s' } }\n",
vp->pending_vol_op->com.proto_version,
vp->pending_vol_op->com.programType,
vp->pending_vol_op->com.command,
vp->pending_vol_op->com.reason,
vp->pending_vol_op->com.command_len,
vp->pending_vol_op->com.flags,
- vp->pending_vol_op->vop.volume,
+ afs_printable_VolumeId_lu(vp->pending_vol_op->vop.volume),
vp->pending_vol_op->vop.partName );
- Log("vcom = { com = { ver=%u, prog=%d, com=%d, reason=%d, len=%u, flags=0x%x } , vop = { vol=%u, part='%s' } }\n",
+ Log("vcom = { com = { ver=%u, prog=%d, com=%d, reason=%d, len=%u, flags=0x%x } , vop = { vol=%" AFS_VOLID_FMT ", part='%s' } }\n",
vcom->hdr->proto_version,
vcom->hdr->programType,
vcom->hdr->command,
vcom->hdr->reason,
vcom->hdr->command_len,
vcom->hdr->flags,
- vcom->vop->volume,
+ afs_printable_VolumeId_lu(vcom->vop->volume),
vcom->vop->partName);
res->hdr.reason = FSYNC_EXCLUSIVE;
goto deny;
} else {
- Log("warning: volume %u recursively checked out by programType id %d\n",
- vp->hashid, vcom->hdr->programType);
+ Log("warning: volume %" AFS_VOLID_FMT " recursively checked out by programType id %d\n",
+ afs_printable_VolumeId_lu(vp->hashid), vcom->hdr->programType);
}
}
case volumeUtility:
case volumeServer:
if (VIsSalvaging(vp)) {
- Log("denying offline request for volume %lu; volume is in salvaging state\n",
- afs_printable_uint32_lu(vp->hashid));
+ Log("denying offline request for volume %" AFS_VOLID_FMT "; volume is in salvaging state\n",
+ afs_printable_VolumeId_lu(vp->hashid));
res->hdr.reason = FSYNC_SALVAGE;
/* the volume hasn't been checked out yet by the salvager,
break;
}
- Log("FSYNC_com_VolOff: failed to get heavyweight reference to volume %u (state=%u, flags=0x%x)\n",
- vcom->vop->volume, V_attachState(vp), V_attachFlags(vp));
+ Log("FSYNC_com_VolOff: failed to get heavyweight reference to volume %" AFS_VOLID_FMT " (state=%u, flags=0x%x)\n",
+ afs_printable_VolumeId_lu(vcom->vop->volume),
+ V_attachState(vp), V_attachFlags(vp));
res->hdr.reason = FSYNC_VOL_PKG_ERROR;
goto deny;
} else if (nvp != vp) {
if (VVolOpLeaveOnline_r(vp, &info)) {
VUpdateVolume_r(&error, vp, VOL_UPDATE_WAIT); /* At least get volume stats right */
if (LogLevel) {
- Log("FSYNC: Volume %u (%s) was left on line for an external %s request\n",
- V_id(vp), V_name(vp),
+ Log("FSYNC: Volume %" AFS_VOLID_FMT " (%s) was left on line for an external %s request\n",
+ afs_printable_VolumeId_lu(V_id(vp)), V_name(vp),
vcom->hdr->reason == V_CLONE ? "clone" :
vcom->hdr->reason == V_READONLY ? "readonly" :
vcom->hdr->reason == V_DUMP ? "dump" :
}
if ((code == SYNC_OK) && (V_BreakVolumeCallbacks != NULL)) {
- Log("fssync: volume %u moved to %x; breaking all call backs\n",
- vcom->vop->volume, vcom->hdr->reason);
+ Log("fssync: volume %" AFS_VOLID_FMT " moved to %x; breaking all call backs\n",
+ afs_printable_VolumeId_lu(vcom->vop->volume), vcom->hdr->reason);
VOL_UNLOCK;
(*V_BreakVolumeCallbacks) (vcom->vop->volume);
VOL_LOCK;
{
/* if the volume is being restored, break all callbacks on it */
if (V_BreakVolumeCallbacks) {
- Log("fssync: breaking all call backs for volume %u\n",
- vcom->vop->volume);
+ Log("fssync: breaking all call backs for volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(vcom->vop->volume));
VOL_UNLOCK;
(*V_BreakVolumeCallbacks) (vcom->vop->volume);
VOL_LOCK;
}
#else
tvolName[0] = OS_DIRSEPC;
- sprintf(&tvolName[1], VFORMAT, afs_printable_uint32_lu(p[i].volumeID));
+ sprintf(&tvolName[1], VFORMAT, afs_printable_VolumeId_lu(p[i].volumeID));
vp = VAttachVolumeByName_r(&error, p[i].partName, tvolName,
V_VOLUPD);
if (vp)
/* FSYNC flag codes */
struct offlineInfo {
- afs_uint32 volumeID;
+ VolumeId volumeID;
char partName[16];
};
* fssync protocol volume operation request message.
*/
typedef struct FSSYNC_VolOp_hdr {
- afs_uint32 volume; /**< volume id associated with request */
+ VolumeId volume; /**< volume id associated with request */
char partName[16]; /**< partition name, e.g. /vicepa */
} FSSYNC_VolOp_hdr;
* fssync protocol vnode query request message.
*/
typedef struct FSSYNC_VnQry_hdr {
- afs_uint32 volume; /**< volume id */
+ VolumeId volume; /**< volume id */
afs_uint32 vnode; /**< vnode id */
afs_uint32 unique; /**< uniqifier */
afs_uint32 spare; /**< reserved for future use */
/* Inode handle */
typedef struct IHandle_s {
- afs_uint32 ih_vid; /* Parent volume id. */
+ VolumeId ih_vid; /* Parent volume id. */
int ih_dev; /* device id. */
int ih_flags; /* Flags */
int ih_synced; /* should be synced next time */
*/
int
ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- afs_uint32 (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
+ afs_uint32 (*judgeInode) (), VolumeId judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
Log("ListViceInodes not implemented for this platform!\n");
int
ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), VolumeId judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
char dev[50], rdev[51];
int
xfs_ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (), afs_uint32 judgeParam, int *forcep,
+ int (*judgeInode) (), VolumeId judgeParam, int *forcep,
int forceR, char *wpath, void *rock)
{
i_list_inode_t info;
int
ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), VolumeId judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
char dev[50], rdev[51];
extern char *afs_rawname();
int
ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), VolumeId judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
union {
#endif /* AFS_LINUX20_ENV */
static afs_int32
-convertVolumeInfo(FdHandle_t *fdhr, FdHandle_t *fdhw, afs_uint32 vid)
+convertVolumeInfo(FdHandle_t *fdhr, FdHandle_t *fdhw, VolumeId vid)
{
struct VolumeDiskData vd;
char *p;
#ifdef FSSYNC_BUILD_CLIENT
int
-inode_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
+inode_ConvertROtoRWvolume(char *pname, VolumeId volumeId)
{
char dir_name[512], oldpath[512], newpath[512];
char volname[20];
* types, but if we get that far, this could should be dead by then.
*/
Inode
-namei_MakeSpecIno(int volid, int type)
+namei_MakeSpecIno(VolumeId volid, int type)
{
Inode ino;
ino = NAMEI_INODESPECIAL;
} else {
IHandle_t *th;
IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
- Log("Warning: Lost ref on ihandle dev %d vid %d ino %lld\n",
- th->ih_dev, th->ih_vid, (afs_int64)th->ih_ino);
+ Log("Warning: Lost ref on ihandle dev %d vid %" AFS_VOLID_FMT " ino %lld\n",
+ th->ih_dev, afs_printable_VolumeId_lu(th->ih_vid), (afs_int64)th->ih_ino);
IH_RELEASE(th);
/* If we're less than 0, someone presumably unlinked;
/* ListViceInodes - write inode data to a results file. */
static int DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
- unsigned int volid);
-static int DecodeVolumeName(char *name, unsigned int *vid);
+ VolumeId volid);
+static int DecodeVolumeName(char *name, VolumeId *vid);
static int namei_ListAFSSubDirs(IHandle_t * dirIH,
int (*write_fun) (FD_t,
struct ViceInodeInfo *,
char *, char *), FD_t fp,
int (*judgeFun) (struct ViceInodeInfo *,
- afs_uint32 vid, void *),
- afs_uint32 singleVolumeNumber, void *rock);
+ VolumeId vid, void *),
+ VolumeId singleVolumeNumber, void *rock);
/* WriteInodeInfo
*/
int
ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, void *rock),
- afs_uint32 singleVolumeNumber, int *forcep, int forceR, char *wpath,
+ int (*judgeInode) (struct ViceInodeInfo * info, VolumeId vid, void *rock),
+ VolumeId singleVolumeNumber, int *forcep, int forceR, char *wpath,
void *rock)
{
int ninodes;
int (*writeFun) (FD_t, struct ViceInodeInfo *, char *,
char *),
FD_t fp,
- int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
- afs_uint32 singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, VolumeId, void *),
+ VolumeId singleVolumeNumber, void *rock)
{
IHandle_t ih;
namei_t name;
int (*writeFun) (FD_t, struct ViceInodeInfo *, char *,
char *),
FD_t fp,
- int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
- int singleVolumeNumber,
+ int (*judgeFun) (struct ViceInodeInfo *, VolumeId, void *),
+ VolumeId singleVolumeNumber,
void *rock)
{
int ret = 0;
* consistent with VGID encoded in namei path */
Log("namei_ListAFSSubDirs: warning: inconsistent linktable "
"filename \"%s" OS_DIRSEP "%s\"; salvager will delete it "
- "(dir_vgid=%u, inode_vgid=%u)\n",
- path1, dname, myIH->ih_vid,
- info.u.param[0]);
+ "(dir_vgid=%" AFS_VOLID_FMT ", inode_vgid=%" AFS_VOLID_FMT ")\n",
+ path1, dname, afs_printable_VolumeId_lu(myIH->ih_vid),
+ afs_printable_VolumeId_lu(info.u.param[0]));
} else {
char path2[512];
/* Open this handle */
int (*writeFun) (FD_t, struct ViceInodeInfo *, char *,
char *),
FD_t fp,
- int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
- int singleVolumeNumber,
+ int (*judgeFun) (struct ViceInodeInfo *, VolumeId, void *),
+ VolumeId singleVolumeNumber,
void *rock)
{
int ret = 0;
int (*writeFun) (FD_t, struct ViceInodeInfo *, char *, char *);
/** inode filter function */
- int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *);
- int singleVolumeNumber; /**< volume id filter */
+ int (*judgeFun) (struct ViceInodeInfo *, VolumeId, void *);
+ VolumeId singleVolumeNumber; /**< volume id filter */
void * rock; /**< pointer passed to writeFun and judgeFun */
int code; /**< return code from examine function */
int special; /**< asserted when this is a volume
int (*writeFun) (FD_t, struct ViceInodeInfo *, char *,
char *),
FD_t fp,
- int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
- afs_uint32 singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, VolumeId, void *),
+ VolumeId singleVolumeNumber, void *rock)
{
int code = 0, ret = 0;
IHandle_t myIH = *dirIH;
#endif
if (linkHandle.fd_fd == INVALID_FD) {
- Log("namei_ListAFSSubDirs: warning: VG %u does not have a link table; "
- "salvager will recreate it.\n", dirIH->ih_vid);
+ Log("namei_ListAFSSubDirs: warning: VG %" AFS_VOLID_FMT " does not have a link table; "
+ "salvager will recreate it.\n", afs_printable_VolumeId_lu(dirIH->ih_vid));
}
/* Now run through all the other subdirs */
#ifdef AFS_NT40_ENV
static int
-DecodeVolumeName(char *name, unsigned int *vid)
+DecodeVolumeName(char *name, VolumeId *vid)
{
/* Name begins with "Vol_" and ends with .data. See nt_HandleToVolDir() */
char stmp[32];
}
#else
static int
-DecodeVolumeName(char *name, unsigned int *vid)
+DecodeVolumeName(char *name, VolumeId *vid)
{
if (strlen(name) < 1)
return -1;
#ifdef AFS_NT40_ENV
static int
DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
- unsigned int volid)
+ VolumeId volid)
{
char fpath[512];
int tag, vno;
#else
static int
DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
- unsigned int volid)
+ VolumeId volid)
{
char fpath[512];
struct afs_stat_st status;
#ifdef FSSYNC_BUILD_CLIENT
static afs_int32
-convertVolumeInfo(FD_t fdr, FD_t fdw, afs_uint32 vid)
+convertVolumeInfo(FD_t fdr, FD_t fdw, VolumeId vid)
{
struct VolumeDiskData vd;
char *p;
if (OS_READ(fdr, &vd, sizeof(struct VolumeDiskData)) !=
sizeof(struct VolumeDiskData)) {
- Log("1 convertVolumeInfo: read failed for %lu with code %d\n",
- afs_printable_uint32_lu(vid),
+ Log("1 convertVolumeInfo: read failed for %" AFS_VOLID_FMT " with code %d\n",
+ afs_printable_VolumeId_lu(vid),
errno);
return -1;
}
*/
int
-namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
+namei_ConvertROtoRWvolume(char *pname, VolumeId volumeId)
{
int code = 0;
#ifdef FSSYNC_BUILD_CLIENT
largeSeen = 1;
} else {
closedir(dirp);
- Log("1 namei_ConvertROtoRWvolume: unknown type %d of special file found : %s" OS_DIRSEP "%s\n", info.u.param[2], dir_name, dp->d_name);
+ Log("1 namei_ConvertROtoRWvolume: unknown type %u of special file found : %s" OS_DIRSEP "%s\n", info.u.param[2], dir_name, dp->d_name);
code = -1;
goto done;
}
extern int namei_unlink(char *name);
/* Inode operations */
-extern Inode namei_MakeSpecIno(int volid, int type);
+extern Inode namei_MakeSpecIno(VolumeId volid, int type);
extern Inode namei_icreate(IHandle_t * lh, char *part, afs_uint32 p1,
afs_uint32 p2, afs_uint32 p3, afs_uint32 p4);
extern FD_t namei_iopen(IHandle_t * h);
struct ViceInodeInfo * info,
char *dir, char *file), FD_t fp,
int (*judge_fun) (struct ViceInodeInfo * info,
- afs_uint32 vid, void *rock),
- afs_uint32 singleVolumeNumber, void *rock);
+ VolumeId vid, void *rock),
+ VolumeId singleVolumeNumber, void *rock);
int ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
- int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid,
+ int (*judgeInode) (struct ViceInodeInfo * info, VolumeId vid,
void *rock),
- afs_uint32 singleVolumeNumber, int *forcep, int forceR,
+ VolumeId singleVolumeNumber, int *forcep, int forceR,
char *wpath, void *rock);
#define NAMEI_LCOMP_LEN 32
#endif
void namei_HandleToName(namei_t * name, IHandle_t * h);
-int namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId);
+int namei_ConvertROtoRWvolume(char *pname, VolumeId volumeId);
int namei_replace_file_by_hardlink(IHandle_t *hLink, IHandle_t *hTarget);
# ifdef AFS_SALSRV_ENV
* Note that ainfo->u.param[0] is always the volume ID, for any vice inode.
*/
static int
-NukeProc(struct ViceInodeInfo *ainfo, afs_uint32 avolid, void *arock)
+NukeProc(struct ViceInodeInfo *ainfo, VolumeId avolid, void *arock)
{
struct ilist **allInodes = (struct ilist **)arock;
struct ilist *ti;
* indices will be gone.
*/
int
-nuke(char *aname, afs_int32 avolid)
+nuke(char *aname, VolumeId avolid)
{
/* first process the partition containing this junk */
struct afs_stat_st tstat;
* The handle needs to be dereferenced with the FidZap() routine.
*/
void
-SetSalvageDirHandle(DirHandle * dir, afs_int32 volume, Device device,
+SetSalvageDirHandle(DirHandle * dir, VolumeId volume, Device device,
Inode inode, int *volumeChanged)
{
static int SalvageCacheCheck = 1;
}
int
-FidVolEq(DirHandle * afile, afs_int32 vid)
+FidVolEq(DirHandle * afile, VolumeId vid)
{
if (afile->dirh_volume != vid)
return 0;
static struct QueueHead SalvageHashTable[VSHASH_SIZE];
static struct SalvageQueueNode *
-LookupNode(afs_uint32 vid, char * partName,
+LookupNode(VolumeId vid, char * partName,
struct SalvageQueueNode ** parent)
{
struct rx_queue *qp, *nqp;
{
struct SalvageQueueNode * node;
char partName[16];
- afs_uint32 volids[VOLMAXTYPES+1];
+ VolumeId volids[VOLMAXTYPES+1];
unsigned int idx;
memset(volids, 0, sizeof(volids));
typedef struct SALVSYNC_command_hdr {
afs_uint32 hdr_version; /**< salvsync protocol header version */
afs_uint32 prio; /**< salvage priority */
- afs_uint32 volume; /**< volume on which to operate */
+ VolumeId volume; /**< volume on which to operate */
afs_uint32 parent; /**< parent volume (for vol group linking command) */
char partName[16]; /**< partition name, e.g. /vicepa */
afs_uint32 reserved[6];
/* The four inode parameters for most inodes (files, directories,
symbolic links) */
struct InodeParams {
- VolId volumeId;
+ VolumeId volumeId;
VnodeId vnodeNumber;
Unique vnodeUniquifier;
FileVersion inodeDataVersion;
/* The four inode parameters for special inodes, i.e. the descriptive
inodes for a volume */
struct SpecialInodeParams {
- VolId volumeId;
+ VolumeId volumeId;
VnodeId vnodeNumber; /* this must be INODESPECIAL */
#ifdef AFS_3DISPARES
- VolId parentId;
+ VolumeId parentId;
int type;
#else
int type;
- VolId parentId;
+ VolumeId parentId;
#endif
};
* this vnode number was free, so something is wrong. */
if (vnp->disk.type != vNull) {
Error tmp;
- Log("VAllocVnode: addled bitmap or vnode object! (vol %ld, "
- "vnode %p, number %ld, type %ld)\n", (long)vp->hashid, vnp,
+ Log("VAllocVnode: addled bitmap or vnode object! (vol %" AFS_VOLID_FMT ", "
+ "vnode %p, number %ld, type %ld)\n", afs_printable_VolumeId_lu(vp->hashid), vnp,
(long)Vn_id(vnp), (long)vnp->disk.type);
*ec = EIO;
VFreeBitMapEntry_r(&tmp, vp, &vp->vnodeIndex[class], bitNumber,
dosalv = 0;
} else if (nBytes == -1 && errno == EIO) {
/* disk error; salvage */
- Log("VnLoad: Couldn't read vnode %u, volume %u (%s); volume needs salvage\n", Vn_id(vnp), V_id(vp), V_name(vp));
+ Log("VnLoad: Couldn't read vnode %u, volume %" AFS_VOLID_FMT " (%s); volume needs salvage\n", Vn_id(vnp), afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
} else {
/* vnode is not allocated */
if (LogLevel >= 5)
- Log("VnLoad: Couldn't read vnode %u, volume %u (%s); read %d bytes, errno %d\n",
- Vn_id(vnp), V_id(vp), V_name(vp), (int)nBytes, errno);
+ Log("VnLoad: Couldn't read vnode %u, volume %" AFS_VOLID_FMT " (%s); read %d bytes, errno %d\n",
+ Vn_id(vnp), afs_printable_VolumeId_lu(V_id(vp)), V_name(vp), (int)nBytes, errno);
*ec = VIO;
dosalv = 0;
}
if ((offset >= index->bitmapSize)
|| ((*(index->bitmap + offset) & (1 << (bitNumber & 0x7)))
== 0)) {
- Log("VnLoad: Request for unallocated vnode %u, volume %u (%s) denied.\n", Vn_id(vnp), V_id(vp), V_name(vp));
+ Log("VnLoad: Request for unallocated vnode %u, volume %" AFS_VOLID_FMT " (%s) denied.\n", Vn_id(vnp), afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
*ec = VNOVNODE;
dosalv = 0;
} else {
- Log("VnLoad: Bad magic number, vnode %u, volume %u (%s); volume needs salvage\n", Vn_id(vnp), V_id(vp), V_name(vp));
+ Log("VnLoad: Bad magic number, vnode %u, volume %" AFS_VOLID_FMT " (%s); volume needs salvage\n", Vn_id(vnp), afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
}
}
goto error_encountered;
}
- IH_INIT(vnp->handle, V_device(vp), V_parentId(vp), VN_GET_INO(vnp));
+ IH_INIT(vnp->handle, V_device(vp), afs_printable_VolumeId_lu(V_parentId(vp)), VN_GET_INO(vnp));
VnUnlock(vnp, WRITE_LOCK);
#ifdef AFS_DEMAND_ATTACH_FS
VnChangeState_r(vnp, VN_STATE_ONLINE);
VnChangeState_r(vnp, VN_STATE_ERROR);
#endif
} else {
- Log("VnStore: Couldn't write vnode %u, volume %u (%s) (error %d)\n", Vn_id(vnp), V_id(Vn_volume(vnp)), V_name(Vn_volume(vnp)), (int)nBytes);
+ Log("VnStore: Couldn't write vnode %u, volume %" AFS_VOLID_FMT " (%s) (error %d)\n", Vn_id(vnp), afs_printable_VolumeId_lu(V_id(Vn_volume(vnp))), V_name(Vn_volume(vnp)), (int)nBytes);
#ifdef AFS_DEMAND_ATTACH_FS
goto error_encountered;
#else
afs_int64 diff_k = volumeTotals.size_k - volumeTotals.diskused_k;
PrintVolumeSizeHeading();
- printf("%u\t%9llu%9llu%10llu%10llu%9lld\t%24s\n",
- V_id(vp),
+ printf("%" AFS_VOLID_FMT "\t%9llu%9llu%10llu%10llu%9lld\t%24s\n",
+ afs_printable_VolumeId_lu(V_id(vp)),
volumeTotals.diskused_k,
volumeTotals.auxsize_k, volumeTotals.vnodesize_k,
volumeTotals.size_k, diff_k, V_name(vp));
* @return 0 if successful
*/
static int
-ScanPartitions(char *partNameOrId, afs_uint32 volumeId)
+ScanPartitions(char *partNameOrId, VolumeId volumeId)
{
int err = 0;
char partName[64] = "";
}
}
snprintf(name1, sizeof name1, VFORMAT,
- afs_printable_uint32_lu(volumeId));
+ afs_printable_VolumeId_lu(volumeId));
if (PrintHeading) {
PrintColumnHeading();
}
VolInfo(struct cmd_syndesc *as, void *arock)
{
struct cmd_item *ti;
- afs_uint32 volumeId = 0;
+ VolumeId volumeId = 0;
char *partNameOrId = NULL;
DumpInfo = 1; /* volinfo default mode */
VolScan(struct cmd_syndesc *as, void *arock)
{
struct cmd_item *ti;
- afs_uint32 volumeId = 0;
+ VolumeId volumeId = 0;
char *partNameOrId = NULL;
int i;
fdP = IH_OPEN(ih);
if (fdP == NULL) {
fprintf(stderr,
- "%s: Error opening header file '%s' for volume %u\n", progname,
- name, header->id);
+ "%s: Error opening header file '%s' for volume %" AFS_VOLID_FMT "\n", progname,
+ name, afs_printable_VolumeId_lu(header->id));
perror("open");
goto error;
}
size = FDH_SIZE(fdP);
if (size == -1) {
fprintf(stderr,
- "%s: Error getting size of header file '%s' for volume %u\n",
- progname, name, header->id);
+ "%s: Error getting size of header file '%s' for volume %" AFS_VOLID_FMT "\n",
+ progname, name, afs_printable_VolumeId_lu(header->id));
perror("fstat");
goto error;
}
size = OS_SIZE(header_fd);
printf("Volume header (size = %lld):\n", size);
printf("\tstamp\t= 0x%x\n", header->stamp.version);
- printf("\tVolId\t= %u\n", header->id);
- printf("\tparent\t= %u\n", header->parent);
+ printf("\tVolId\t= %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(header->id));
+ printf("\tparent\t= %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(header->parent));
}
HandleSpecialFile("Info", dp, header, header->volumeInfo, &size);
case BACKVOL:
return ScanVolType & SCAN_BK;
default:
- fprintf(stderr, "%s: Volume %u; Unknown volume type %d\n", progname,
- V_id(vp), V_type(vp));
+ fprintf(stderr, "%s: Volume %" AFS_VOLID_FMT "; Unknown volume type %d\n", progname,
+ afs_printable_VolumeId_lu(V_id(vp)), V_type(vp));
break;
}
return 0;
void
PrintHeader(Volume * vp)
{
- printf("Volume header for volume %u (%s)\n", V_id(vp), V_name(vp));
+ printf("Volume header for volume %" AFS_VOLID_FMT " (%s)\n", afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
printf("stamp.magic = %x, stamp.version = %u\n", V_stamp(vp).magic,
V_stamp(vp).version);
printf
V_type(vp), volumeTypeString(V_type(vp)), V_uniquifier(vp),
V_needsCallback(vp), V_destroyMe(vp));
printf
- ("id = %u, parentId = %u, cloneId = %u, backupId = %u, restoredFromId = %u\n",
- V_id(vp), V_parentId(vp), V_cloneId(vp), V_backupId(vp),
- V_restoredFromId(vp));
+ ("id = %" AFS_VOLID_FMT ", parentId = %" AFS_VOLID_FMT ", cloneId = %" AFS_VOLID_FMT ", backupId = %" AFS_VOLID_FMT ", restoredFromId = %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(V_id(vp)), afs_printable_VolumeId_lu(V_parentId(vp)), afs_printable_VolumeId_lu(V_cloneId(vp)), afs_printable_VolumeId_lu(V_backupId(vp)), afs_printable_VolumeId_lu(V_restoredFromId(vp)));
printf
("maxquota = %d, minquota = %d, maxfiles = %d, filecount = %d, diskused = %d\n",
V_maxquota(vp), V_minquota(vp), V_maxfiles(vp), V_filecount(vp),
afs_int32 code;
code = VDestroyVolumeDiskHeader(salvinfo->fileSysPartition, vsp->header.id, vsp->header.parent);
if (code) {
- Log("Error %ld destroying volume disk header for volume %lu\n",
+ Log("Error %ld destroying volume disk header for volume %" AFS_VOLID_FMT "\n",
afs_printable_int32_ld(code),
- afs_printable_uint32_lu(vsp->header.id));
+ afs_printable_VolumeId_lu(vsp->header.id));
}
/* make sure we actually delete the header file; ENOENT
}
int
-OnlyOneVolume(struct ViceInodeInfo *inodeinfo, afs_uint32 singleVolumeNumber, void *rock)
+OnlyOneVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber, void *rock)
{
if (inodeinfo->u.vnode.vnodeNumber == INODESPECIAL)
return (inodeinfo->u.special.parentId == singleVolumeNumber);
}
if (code) {
- Log("fileserver refused VGCQuery request for volume %lu on "
+ Log("fileserver refused VGCQuery request for volume %" AFS_VOLID_FMT " on "
"partition %s, code %ld reason %ld\n",
- afs_printable_uint32_lu(singleVolumeNumber),
+ afs_printable_VolumeId_lu(singleVolumeNumber),
salvinfo->fileSysPartition->name,
afs_printable_int32_ld(code),
afs_printable_int32_ld(res.hdr.reason));
}
if (q_res.rw != singleVolumeNumber) {
- Log("fileserver requested salvage of clone %lu; scheduling salvage of volume group %lu...\n",
- afs_printable_uint32_lu(singleVolumeNumber),
- afs_printable_uint32_lu(q_res.rw));
+ Log("fileserver requested salvage of clone %" AFS_VOLID_FMT "; scheduling salvage of volume group %" AFS_VOLID_FMT "...\n",
+ afs_printable_VolumeId_lu(singleVolumeNumber),
+ afs_printable_VolumeId_lu(q_res.rw));
#ifdef SALVSYNC_BUILD_CLIENT
if (SALVSYNC_LinkVolume(q_res.rw,
singleVolumeNumber,
if (programType == salvageServer) {
#ifdef SALVSYNC_BUILD_CLIENT
- Log("fileserver requested salvage of clone %u; scheduling salvage of volume group %u...\n",
- summary.header.id, summary.header.parent);
+ Log("fileserver requested salvage of clone %" AFS_VOLID_FMT "; scheduling salvage of volume group %" AFS_VOLID_FMT "...\n",
+ afs_printable_VolumeId_lu(summary.header.id),
+ afs_printable_VolumeId_lu(summary.header.parent));
if (SALVSYNC_LinkVolume(summary.header.parent,
summary.header.id,
dp->name,
Exit(SALSRV_EXIT_VOLGROUP_LINK);
} else {
- Log("%u is a read-only volume; not salvaged\n",
- singleVolumeNumber);
+ Log("%" AFS_VOLID_FMT " is a read-only volume; not salvaged\n",
+ afs_printable_VolumeId_lu(singleVolumeNumber));
Exit(1);
}
}
}
snprintf(nameShouldBe, sizeof nameShouldBe,
- VFORMAT, afs_printable_uint32_lu(summary.header.id));
+ VFORMAT, afs_printable_VolumeId_lu(summary.header.id));
if (strcmp(nameShouldBe, base)) {
INODESPECIAL, VI_LINKTABLE, isp->RWvolumeId);
if (!VALID_INO(ino))
Abort
- ("Unable to allocate link table inode for volume %u (error = %d)\n",
- isp->RWvolumeId, errno);
+ ("Unable to allocate link table inode for volume %" AFS_VOLID_FMT " (error = %d)\n",
+ afs_printable_VolumeId_lu(isp->RWvolumeId), errno);
IH_INIT(salvinfo->VGLinkH, salvinfo->fileSysDevice, isp->RWvolumeId, ino);
fdP = IH_OPEN(salvinfo->VGLinkH);
if (fdP == NULL)
- Abort("Can't open link table for volume %u (error = %d)\n",
- isp->RWvolumeId, errno);
+ Abort("Can't open link table for volume %" AFS_VOLID_FMT " (error = %d)\n",
+ afs_printable_VolumeId_lu(isp->RWvolumeId), errno);
if (FDH_TRUNC(fdP, sizeof(version) + sizeof(short)) < 0)
- Abort("Can't truncate link table for volume %u (error = %d)\n",
- isp->RWvolumeId, errno);
+ Abort("Can't truncate link table for volume %" AFS_VOLID_FMT " (error = %d)\n",
+ afs_printable_VolumeId_lu(isp->RWvolumeId), errno);
version.magic = LINKTABLEMAGIC;
version.version = LINKTABLEVERSION;
if (FDH_PWRITE(fdP, (char *)&version, sizeof(version), 0)
!= sizeof(version))
- Abort("Can't truncate link table for volume %u (error = %d)\n",
- isp->RWvolumeId, errno);
+ Abort("Can't truncate link table for volume %" AFS_VOLID_FMT " (error = %d)\n",
+ afs_printable_VolumeId_lu(isp->RWvolumeId), errno);
FDH_REALLYCLOSE(fdP);
nBytes = FDH_PREAD(fdP, (char *)&header, sizeof(struct versionStamp), 0);
if (nBytes != sizeof(struct versionStamp)
|| header.magic != LINKTABLEMAGIC) {
- Log("Bad linktable header for volume %u.\n", isp->RWvolumeId);
+ Log("Bad linktable header for volume %" AFS_VOLID_FMT ".\n", afs_printable_VolumeId_lu(isp->RWvolumeId));
FDH_REALLYCLOSE(fdP);
fdP = NULL;
}
}
if (!VALID_INO(ino) || fdP == NULL) {
- Log("%s link table for volume %u.\n",
- Testing ? "Would have recreated" : "Recreating", isp->RWvolumeId);
+ Log("%s link table for volume %" AFS_VOLID_FMT ".\n",
+ Testing ? "Would have recreated" : "Recreating", afs_printable_VolumeId_lu(isp->RWvolumeId));
if (Testing) {
IH_INIT(salvinfo->VGLinkH, salvinfo->fileSysDevice, -1, -1);
} else {
}
#endif
if (!Showmode)
- Log("%s VOLUME %u%s.\n", rw ? "SALVAGING" : "CHECKING CLONED",
- lisp->volumeId, (Testing ? "(READONLY mode)" : ""));
+ Log("%s VOLUME %" AFS_VOLID_FMT "%s.\n", rw ? "SALVAGING" : "CHECKING CLONED",
+ afs_printable_VolumeId_lu(lisp->volumeId), (Testing ? "(READONLY mode)" : ""));
/* Check inodes twice. The second time do things seriously. This
* way the whole RO volume can be deleted, below, if anything goes wrong */
for (check = 1; check >= 0; check--) {
#endif
if (ip->linkCount != 0 && TraceBadLinkCounts) {
TraceBadLinkCounts--; /* Limit reports, per volume */
- Log("#### DEBUG #### Link count incorrect by %d; inode %s, size %llu, p=(%u,%u,%u,%u)\n", ip->linkCount, PrintInode(stmp, ip->inodeNumber), (afs_uintmax_t) ip->byteCount, ip->u.param[0], ip->u.param[1], ip->u.param[2], ip->u.param[3]);
+ Log("#### DEBUG #### Link count incorrect by %d; inode %s, size %llu, p=(%u,%u,%u,%u)\n", ip->linkCount, PrintInode(stmp, ip->inodeNumber), (afs_uintmax_t) ip->byteCount, ip->u.param[0], ip->u.param[1], ip->u.param[2], ip->u.param[3]); /* VolumeId in param */
}
while (ip->linkCount > 0) {
/* below used to assert, not break */
continue;
}
if (!Showmode) {
- Log("Duplicate special %d inodes for volume %u found (%s, %s);\n",
- ip->u.special.type, isp->volumeId,
+ Log("Duplicate special %d inodes for volume %" AFS_VOLID_FMT " found (%s, %s);\n",
+ ip->u.special.type, afs_printable_VolumeId_lu(isp->volumeId),
PrintInode(stmp1, ip->inodeNumber),
PrintInode(stmp2, (ip+1)->inodeNumber));
}
}
} else {
if (!Showmode)
- Log("cannot determine which is correct; salvage of volume %u aborted\n", isp->volumeId);
+ Log("cannot determine which is correct; salvage of volume %" AFS_VOLID_FMT " aborted\n", afs_printable_VolumeId_lu(isp->volumeId));
if (skip) {
free(skip);
}
char path[64];
char headerName[64];
snprintf(headerName, sizeof headerName, VFORMAT,
- afs_printable_uint32_lu(isp->volumeId));
+ afs_printable_VolumeId_lu(isp->volumeId));
snprintf(path, sizeof path, "%s" OS_DIRSEP "%s",
salvinfo->fileSysPath, headerName);
if (check) {
- Log("No header file for volume %u\n", isp->volumeId);
+ Log("No header file for volume %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(isp->volumeId));
return -1;
}
if (!Showmode)
- Log("No header file for volume %u; %screating %s\n",
- isp->volumeId, (Testing ? "it would have been " : ""),
+ Log("No header file for volume %" AFS_VOLID_FMT "; %screating %s\n",
+ afs_printable_VolumeId_lu(isp->volumeId), (Testing ? "it would have been " : ""),
path);
isp->volSummary = calloc(1, sizeof(struct VolumeSummary));
sizeof(struct VolumeHeader));
if (Testing) {
if (!Showmode)
- Log("It would have written a new header file for volume %u\n",
- isp->volumeId);
+ Log("It would have written a new header file for volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(isp->volumeId));
} else {
afs_int32 code;
VolumeHeaderToDisk(&diskHeader, &tempHeader);
code = (*writefunc)(&diskHeader, salvinfo->fileSysPartition);
if (code) {
- Log("Error %ld writing volume header file for volume %lu\n",
+ Log("Error %ld writing volume header file for volume %" AFS_VOLID_FMT "\n",
afs_printable_int32_ld(code),
- afs_printable_uint32_lu(diskHeader.id));
+ afs_printable_VolumeId_lu(diskHeader.id));
return -1;
}
}
header.volumeInfo.stamp = sp->stamp;
header.volumeInfo.id = isp->volumeId;
header.volumeInfo.parentId = isp->RWvolumeId;
- sprintf(header.volumeInfo.name, "bogus.%u", isp->volumeId);
- Log("Warning: the name of volume %u is now \"bogus.%u\"\n",
- isp->volumeId, isp->volumeId);
+ sprintf(header.volumeInfo.name, "bogus.%" AFS_VOLID_FMT, afs_printable_VolumeId_lu(isp->volumeId));
+ Log("Warning: the name of volume %" AFS_VOLID_FMT " is now \"bogus.%" AFS_VOLID_FMT "\"\n",
+ afs_printable_VolumeId_lu(isp->volumeId), afs_printable_VolumeId_lu(isp->volumeId));
header.volumeInfo.inService = 0;
header.volumeInfo.blessed = 0;
/* The + 1000 is a hack in case there are any files out in venus caches */
if (salvinfo->VolInfo.updateDate) {
strcpy(update, TimeStamp(salvinfo->VolInfo.updateDate, 0));
if (!Showmode)
- Log("%s (%u) %supdated %s\n", salvinfo->VolInfo.name,
- salvinfo->VolInfo.id,
+ Log("%s (%" AFS_VOLID_FMT ") %supdated %s\n", salvinfo->VolInfo.name,
+ afs_printable_VolumeId_lu(salvinfo->VolInfo.id),
(Testing ? "it would have been " : ""), update);
} else {
strcpy(update, TimeStamp(salvinfo->VolInfo.creationDate, 0));
if (!Showmode)
- Log("%s (%u) not updated (created %s)\n",
- salvinfo->VolInfo.name, salvinfo->VolInfo.id, update);
+ Log("%s (%" AFS_VOLID_FMT ") not updated (created %s)\n",
+ salvinfo->VolInfo.name, afs_printable_VolumeId_lu(salvinfo->VolInfo.id), update);
}
}
if (nBytes == size) {
buf[size] = '\0';
if ( (*buf != '#' && *buf != '%') || buf[strlen(buf)-1] != '.' ) {
- Log("Volume %u (%s) mount point %s" OS_DIRSEP "%s to '%s' invalid, %s to symbolic link\n",
- dir->dirHandle.dirh_handle->ih_vid, dir->vname, dir->name ? dir->name : "??", name, buf,
+ Log("Volume %" AFS_VOLID_FMT " (%s) mount point %s" OS_DIRSEP "%s to '%s' invalid, %s to symbolic link\n",
+ afs_printable_VolumeId_lu(dir->dirHandle.dirh_handle->ih_vid), dir->vname, dir->name ? dir->name : "??", name, buf,
Testing ? "would convert" : "converted");
vnodeEssence->modeBits |= 0111;
vnodeEssence->changed = 1;
- } else if (ShowMounts) Log("In volume %u (%s) found mountpoint %s" OS_DIRSEP "%s to '%s'\n",
- dir->dirHandle.dirh_handle->ih_vid, dir->vname,
- dir->name ? dir->name : "??", name, buf);
+ } else if (ShowMounts)
+ Log("In volume %" AFS_VOLID_FMT " (%s) found mountpoint %s" OS_DIRSEP "%s to '%s'\n",
+ afs_printable_VolumeId_lu(dir->dirHandle.dirh_handle->ih_vid),
+ dir->vname, dir->name ? dir->name : "??", name, buf);
} else {
Log("Volume %s cound not read mount point vnode %u size %d code %d\n",
dir->vname, vnodeNumber, (int)size, (int)nBytes);
opr_Assert(nBytes == sizeof(volHeader));
}
if (!Showmode) {
- Log("%sSalvaged %s (%u): %d files, %d blocks\n",
- (Testing ? "It would have " : ""), volHeader.name, volHeader.id,
+ Log("%sSalvaged %s (%" AFS_VOLID_FMT "): %d files, %d blocks\n",
+ (Testing ? "It would have " : ""), volHeader.name, afs_printable_VolumeId_lu(volHeader.id),
FilesInVolume, BlocksInVolume);
}
if (isp->volSummary && !isp->volSummary->deleted) {
if (deleteMe) {
if (!Showmode)
- Log("Volume %u (is only a partial volume--probably an attempt was made to move/restore it when a machine crash occured.\n", isp->volumeId);
+ Log("Volume %" AFS_VOLID_FMT " (is only a partial volume--probably an attempt was made to move/restore it when a machine crash occured.\n", afs_printable_VolumeId_lu(isp->volumeId));
if (!Showmode)
Log("It will be deleted on this server (you may find it elsewhere)\n");
} else {
if (!Showmode)
- Log("Volume %u needs to be salvaged. Since it is read-only, however,\n", isp->volumeId);
+ Log("Volume %" AFS_VOLID_FMT " needs to be salvaged. Since it is read-only, however,\n", afs_printable_VolumeId_lu(isp->volumeId));
if (!Showmode)
Log("it will be deleted instead. It should be recloned.\n");
}
code = VDestroyVolumeDiskHeader(salvinfo->fileSysPartition, isp->volumeId, isp->RWvolumeId);
if (code) {
- Log("Error %ld destroying volume disk header for volume %lu\n",
+ Log("Error %ld destroying volume disk header for volume %" AFS_VOLID_FMT "\n",
afs_printable_int32_ld(code),
- afs_printable_uint32_lu(isp->volumeId));
+ afs_printable_VolumeId_lu(isp->volumeId));
}
/* make sure we actually delete the header file; ENOENT
}
}
} else if (!check) {
- Log("%s salvage was unsuccessful: read-write volume %u\n", message,
- isp->volumeId);
- Abort("Salvage of volume %u aborted\n", isp->volumeId);
+ Log("%s salvage was unsuccessful: read-write volume %" AFS_VOLID_FMT "\n", message,
+ afs_printable_VolumeId_lu(isp->volumeId));
+ Abort("Salvage of volume %" AFS_VOLID_FMT " aborted\n", afs_printable_VolumeId_lu(isp->volumeId));
}
}
if (code == SYNC_OK) {
break;
} else if (code == SYNC_DENIED) {
- Log("AskOnline: file server denied online request to volume %u partition %s; trying again...\n", volumeId, salvinfo->fileSysPartition->name);
+ Log("AskOnline: file server denied online request to volume %" AFS_VOLID_FMT " partition %s; trying again...\n", afs_printable_VolumeId_lu(volumeId), salvinfo->fileSysPartition->name);
} else if (code == SYNC_BAD_COMMAND) {
Log("AskOnline: fssync protocol mismatch (bad command word '%d')\n",
FSYNC_VOL_ON);
if (code == SYNC_OK) {
break;
} else if (code == SYNC_DENIED) {
- Log("AskOnline: file server denied DONE request to volume %u partition %s; trying again...\n", volumeId, salvinfo->fileSysPartition->name);
+ Log("AskOnline: file server denied DONE request to volume %" AFS_VOLID_FMT " partition %s; trying again...\n", afs_printable_VolumeId_lu(volumeId), salvinfo->fileSysPartition->name);
} else if (code == SYNC_BAD_COMMAND) {
Log("AskOnline: fssync protocol mismatch (bad command word '%d')\n",
FSYNC_VOL_DONE);
nInodes = st_size / sizeof(struct ViceInodeInfo);
opr_Verify(OS_READ(salvinfo->inodeFd, buf, st_size) == st_size);
for (ip = buf; nInodes--; ip++) {
- Log("Inode:%s, linkCount=%d, size=%#llx, p=(%u,%u,%u,%u)\n",
+ Log("Inode:%s, linkCount=%d, size=%#llx, p=(%" AFS_VOLID_FMT ",%u,%u,%u)\n", /* VolumeId in param */
PrintInode(stmp, ip->inodeNumber), ip->linkCount,
- (afs_uintmax_t) ip->byteCount, ip->u.param[0], ip->u.param[1],
+ (afs_uintmax_t) ip->byteCount,
+ afs_printable_VolumeId_lu(ip->u.param[0]), ip->u.param[1],
ip->u.param[2], ip->u.param[3]);
}
free(buf);
for (i = 0; i < salvinfo->nVolumesInInodeFile; i++) {
isp = &salvinfo->inodeSummary[i];
- Log("VID:%u, RW:%u, index:%d, nInodes:%d, nSpecialInodes:%d, maxUniquifier:%u, volSummary\n", isp->volumeId, isp->RWvolumeId, isp->index, isp->nInodes, isp->nSpecialInodes, isp->maxUniquifier);
+ Log("VID:%" AFS_VOLID_FMT ", RW:%" AFS_VOLID_FMT ", index:%d, nInodes:%d, nSpecialInodes:%d, maxUniquifier:%u, volSummary\n", afs_printable_VolumeId_lu(isp->volumeId), afs_printable_VolumeId_lu(isp->RWvolumeId), isp->index, isp->nInodes, isp->nSpecialInodes, isp->maxUniquifier);
}
}
/* salvager data structures */
struct InodeSummary { /* Inode summary file--an entry for each
* volume in the inode file for a partition */
- VolId volumeId; /* Volume id */
- VolId RWvolumeId; /* RW volume associated */
+ VolumeId volumeId; /* Volume id */
+ VolumeId RWvolumeId; /* RW volume associated */
int index; /* index into inode file (0, 1, 2 ...) */
int nInodes; /* Number of inodes for this volume */
int nSpecialInodes; /* Number of special inodes, i.e. volume
#define AFS_SRC_VOL_INTERNAL_H
/* physio.c */
-extern void SetSalvageDirHandle(DirHandle *, afs_int32, Device, Inode,
+extern void SetSalvageDirHandle(DirHandle *, VolumeId, Device, Inode,
int *);
#endif
/* All volumes will have a volume header name in this format */
#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV)
/* Note that <afs/param.h> must have been included before we get here... */
-#define VFORMAT "V%010lu.vl" /* Sys5's filename length limitation hits us again */
+#define VFORMAT "V%010" AFS_VOLID_FMT ".vl" /* Sys5's filename length limitation hits us again */
#define VHDREXT ".vl"
#else
-#define VFORMAT "V%010lu.vol"
+#define VFORMAT "V%010" AFS_VOLID_FMT ".vol"
#define VHDREXT ".vol"
#endif
#define VHDRNAMELEN (VFORMATDIGITS + 1 + sizeof(VHDREXT) - 1) /* must match VFORMAT */
#endif
/* Forward declarations */
-static Volume *attach2(Error * ec, VolId volumeId, char *path,
+static Volume *attach2(Error * ec, VolumeId volumeId, char *path,
struct DiskPartition64 *partp, Volume * vp,
int isbusy, int mode, int *acheckedOut);
static void ReallyFreeVolume(Volume * vp);
static int GetVolumeHeader(Volume * vp);
static void ReleaseVolumeHeader(struct volHeader *hd);
static void FreeVolumeHeader(Volume * vp);
-static void AddVolumeToHashTable(Volume * vp, int hashid);
+static void AddVolumeToHashTable(Volume * vp, VolumeId hashid);
static void DeleteVolumeFromHashTable(Volume * vp);
#if 0
static int VHold(Volume * vp);
static void LoadVolumeHeader(Error * ec, Volume * vp);
static int VCheckOffline(Volume * vp);
static int VCheckDetach(Volume * vp);
-static Volume * GetVolume(Error * ec, Error * client_ec, VolId volumeId,
+static Volume * GetVolume(Error * ec, Error * client_ec, VolumeId volumeId,
Volume * hint, const struct timespec *ts);
int LogLevel; /* Vice loglevel--not defined as extern so that it will be
static void *VInitVolumePackageThread(void *args);
static struct DiskPartition64 *VInitNextPartition(struct partition_queue *pq);
-static VolId VInitNextVolumeId(DIR *dirp);
+static VolumeId VInitNextVolumeId(DIR *dirp);
static int VInitPreAttachVolumes(int nthreads, struct volume_init_queue *vq);
#endif /* !AFS_DEMAND_ATTACH_FS */
};
struct VLRU_DiskEntry {
- afs_uint32 vid; /* volume ID */
+ VolumeId vid; /* volume ID */
afs_uint32 idx; /* generation */
afs_uint32 last_get; /* timestamp of last get */
};
Log("Scanning partitions on thread %d of %d\n", params->thread, params->nthreads);
while((partition = VInitNextPartition(pq))) {
DIR *dirp;
- VolId vid;
+ VolumeId vid;
Log("Partition %s: pre-attaching volumes\n", partition->name);
dirp = opendir(VPartitionPath(partition));
/**
* Find next volume id on the partition.
*/
-static VolId
+static VolumeId
VInitNextVolumeId(DIR *dirp)
{
struct dirent *d;
- VolId vid = 0;
+ VolumeId vid = 0;
char *ext;
while((d = readdir(dirp))) {
Log("Error looking up volume, code=%d\n", ec);
}
else if (dup) {
- Log("Warning: Duplicate volume id %d detected.\n", vp->hashid);
+ Log("Warning: Duplicate volume id %" AFS_VOLID_FMT " detected.\n", afs_printable_VolumeId_lu(vp->hashid));
}
else {
/* put pre-attached volume onto the hash table
code = VHold_r(vp);
if (code == 0) {
if (LogLevel >= 5)
- Log("VShutdown: Attempting to take volume %u offline.\n",
- vp->hashid);
+ Log("VShutdown: Attempting to take volume %" AFS_VOLID_FMT " offline.\n",
+ afs_printable_VolumeId_lu(vp->hashid));
/* next, take the volume offline (drops reference count) */
VOffline_r(vp, "File server was shut down");
VCreateReservation_r(vp);
if (LogLevel >= 5) {
- Log("VShutdownVolume_r: vid=%u, device=%d, state=%hu\n",
- vp->hashid, vp->partition->device, V_attachState(vp));
+ Log("VShutdownVolume_r: vid=%" AFS_VOLID_FMT ", device=%d, state=%hu\n",
+ afs_printable_VolumeId_lu(vp->hashid), vp->partition->device,
+ V_attachState(vp));
}
/* wait for other blocking ops to finish */
code = VHold_r(vp);
if (!code) {
if (LogLevel >= 5)
- Log("VShutdown: Attempting to take volume %u offline.\n",
- vp->hashid);
+ Log("VShutdown: Attempting to take volume %" AFS_VOLID_FMT " offline.\n",
+ afs_printable_VolumeId_lu(vp->hashid));
/* take the volume offline (drops reference count) */
VOffline_r(vp, "File server was shut down");
fdP = IH_OPEN(h);
if (fdP == NULL) {
Log("ReadHeader: Failed to open %s header file "
- "(volume=%u, inode=%s); errno=%d\n", HeaderName(magic), h->ih_vid,
+ "(volume=%" AFS_VOLID_FMT ", inode=%s); errno=%d\n", HeaderName(magic), afs_printable_VolumeId_lu(h->ih_vid),
PrintInode(stmp, h->ih_ino), errno);
*ec = VSALVAGE;
return;
nbytes = FDH_PREAD(fdP, to, size, 0);
if (nbytes < 0) {
Log("ReadHeader: Failed to read %s header file "
- "(volume=%u, inode=%s); errno=%d\n", HeaderName(magic), h->ih_vid,
+ "(volume=%" AFS_VOLID_FMT ", inode=%s); errno=%d\n", HeaderName(magic), afs_printable_VolumeId_lu(h->ih_vid),
PrintInode(stmp, h->ih_ino), errno);
*ec = VSALVAGE;
FDH_REALLYCLOSE(fdP);
}
if (nbytes != size) {
Log("ReadHeader: Incorrect number of bytes read from %s header file "
- "(volume=%u, inode=%s); expected=%d, read=%d\n",
- HeaderName(magic), h->ih_vid, PrintInode(stmp, h->ih_ino), size,
- (int)nbytes);
+ "(volume=%" AFS_VOLID_FMT ", inode=%s); expected=%d, read=%d\n",
+ HeaderName(magic), afs_printable_VolumeId_lu(h->ih_vid),
+ PrintInode(stmp, h->ih_ino), size, (int)nbytes);
*ec = VSALVAGE;
FDH_REALLYCLOSE(fdP);
return;
}
if (vsn->magic != magic) {
Log("ReadHeader: Incorrect magic for %s header file "
- "(volume=%u, inode=%s); expected=0x%x, read=0x%x\n",
- HeaderName(magic), h->ih_vid, PrintInode(stmp, h->ih_ino), magic,
- vsn->magic);
+ "(volume=%" AFS_VOLID_FMT ", inode=%s); expected=0x%x, read=0x%x\n",
+ HeaderName(magic), afs_printable_VolumeId_lu(h->ih_vid),
+ PrintInode(stmp, h->ih_ino), magic, vsn->magic);
*ec = VSALVAGE;
FDH_REALLYCLOSE(fdP);
return;
/* Check is conditional, in case caller wants to inspect version himself */
if (version && vsn->version != version) {
Log("ReadHeader: Incorrect version for %s header file "
- "(volume=%u, inode=%s); expected=%x, read=%x\n",
- HeaderName(magic), h->ih_vid, PrintInode(stmp, h->ih_ino),
+ "(volume=%" AFS_VOLID_FMT ", inode=%s); expected=%x, read=%x\n",
+ HeaderName(magic), afs_printable_VolumeId_lu(h->ih_vid), PrintInode(stmp, h->ih_ino),
version, vsn->version);
*ec = VSALVAGE;
}
Volume *
VPreAttachVolumeById_r(Error * ec,
char * partition,
- VolId volumeId)
+ VolumeId volumeId)
{
Volume *vp;
struct DiskPartition64 *partp;
VPreAttachVolumeByVp_r(Error * ec,
struct DiskPartition64 * partp,
Volume * vp,
- VolId vid)
+ VolumeId vid)
{
Volume *nvp = NULL;
* - volume is in an error state
* - volume is pre-attached
*/
- Log("VPreattachVolumeByVp_r: volume %u not in quiescent state (state %u flags 0x%x)\n",
- vid, V_attachState(vp), V_attachFlags(vp));
+ Log("VPreattachVolumeByVp_r: volume %" AFS_VOLID_FMT " not in quiescent state (state %u flags 0x%x)\n",
+ afs_printable_VolumeId_lu(vid), V_attachState(vp),
+ V_attachFlags(vp));
goto done;
} else if (vp) {
/* we're re-attaching a volume; clear out some old state */
VChangeState_r(vp, VOL_STATE_PREATTACHED);
if (LogLevel >= 5)
- Log("VPreAttachVolumeByVp_r: volume %u pre-attached\n", vp->hashid);
+ Log("VPreAttachVolumeByVp_r: volume %" AFS_VOLID_FMT " pre-attached\n", afs_printable_VolumeId_lu(vp->hashid));
done:
if (*ec)
struct DiskPartition64 *partp;
char path[64];
int isbusy = 0;
- VolId volumeId;
+ VolumeId volumeId;
int checkedOut;
#ifdef AFS_DEMAND_ATTACH_FS
VolumeStats stats_save;
}
}
if (LogLevel)
- Log("VOnline: volume %u (%s) attached and online\n", V_id(vp),
+ Log("VOnline: volume %" AFS_VOLID_FMT " (%s) attached and online\n", afs_printable_VolumeId_lu(V_id(vp)),
V_name(vp));
}
struct DiskPartition64 *partp;
char path[64];
int isbusy = 0;
- VolId volumeId;
+ VolumeId volumeId;
Volume * nvp = NULL;
VolumeStats stats_save;
int checkedOut;
VUpdateVolume_r(ec, vp, 0);
if (*ec) {
- Log("VAttachVolume: Error updating volume %u\n", vp->hashid);
+ Log("VAttachVolume: Error updating volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(vp->hashid));
VPutVolume_r(vp);
goto done;
}
#endif /* !AFS_DEMAND_ATTACH_FS */
VAddToVolumeUpdateList_r(ec, vp);
if (*ec) {
- Log("VAttachVolume: Error adding volume %u to update list\n", vp->hashid);
+ Log("VAttachVolume: Error adding volume %" AFS_VOLID_FMT " to update list\n",
+ afs_printable_VolumeId_lu(vp->hashid));
if (vp)
VPutVolume_r(vp);
goto done;
}
}
if (LogLevel)
- Log("VOnline: volume %u (%s) attached and online\n", V_id(vp),
- V_name(vp));
+ Log("VOnline: volume %" AFS_VOLID_FMT " (%s) attached and online\n",
+ afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
done:
if (reserve) {
VCancelReservation_r(nvp);
* @post VOL_LOCK held
*/
static Volume *
-attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp,
+attach2(Error * ec, VolumeId volumeId, char *path, struct DiskPartition64 *partp,
Volume * vp, int isbusy, int mode, int *acheckedOut)
{
/* have we read in the header successfully? */
#ifdef AFS_DEMAND_ATTACH_FS
if (!VIsErrorState(V_attachState(vp))) {
if (VIsErrorState(error_state)) {
- Log("attach2: forcing vol %u to error state (state %u flags 0x%x ec %d)\n",
- vp->hashid, V_attachState(vp), V_attachFlags(vp), *ec);
+ Log("attach2: forcing vol %" AFS_VOLID_FMT " to error state (state %u flags 0x%x ec %d)\n",
+ afs_printable_VolumeId_lu(vp->hashid), V_attachState(vp),
+ V_attachFlags(vp), *ec);
}
VChangeState_r(vp, error_state);
}
of whether or not the volume is in service or on/off line. An error
code, however, is returned with an indication of the volume's status */
Volume *
-VGetVolume(Error * ec, Error * client_ec, VolId volumeId)
+VGetVolume(Error * ec, Error * client_ec, VolumeId volumeId)
{
Volume *retVal;
VOL_LOCK;
* VPutVolumeWithCall
*/
Volume *
-VGetVolumeWithCall(Error * ec, Error * client_ec, VolId volumeId,
+VGetVolumeWithCall(Error * ec, Error * client_ec, VolumeId volumeId,
const struct timespec *ts, struct VCallByVol *cbv)
{
Volume *retVal;
}
Volume *
-VGetVolume_r(Error * ec, VolId volumeId)
+VGetVolume_r(Error * ec, VolumeId volumeId)
{
return GetVolume(ec, NULL, volumeId, NULL, NULL);
}
* @note for LWP builds, 'timeout' must be NULL
*/
static Volume *
-GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint,
+GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint,
const struct timespec *timeout)
{
Volume *vp = hint;
/* Only log the error if it was a totally unexpected error. Simply
* a missing inode is likely to be caused by the volume being deleted */
if (errno != ENXIO || LogLevel)
- Log("Volume %u: couldn't reread volume header\n",
- vp->hashid);
+ Log("Volume %" AFS_VOLID_FMT ": couldn't reread volume header\n",
+ afs_printable_VolumeId_lu(vp->hashid));
#ifdef AFS_DEMAND_ATTACH_FS
if (VCanScheduleSalvage()) {
VRequestSalvage_r(ec, vp, SALVSYNC_ERROR, 0 /*flags*/);
strcpy(V_offlineMessage(vp),
"Forced offline due to internal error: volume needs to be salvaged");
- Log("Volume %u forced offline: it needs salvaging!\n", V_id(vp));
+ Log("Volume %" AFS_VOLID_FMT " forced offline: it needs salvaging!\n", afs_printable_VolumeId_lu(V_id(vp)));
V_inUse(vp) = 0;
vp->goingOffline = 0;
char hoststr[16];
peer = rx_PeerOf(rx_ConnectionOf(cbv->call));
- Log("Offlining volume %lu while client %s:%u is trying to read "
+ Log("Offlining volume %" AFS_VOLID_FMT " while client %s:%u is trying to read "
"from it; kicking client off with error %ld\n",
- (long unsigned) vp->hashid,
+ afs_printable_VolumeId_lu(vp->hashid),
afs_inet_ntoa_r(rx_HostOf(peer), hoststr),
(unsigned) ntohs(rx_PortOf(peer)),
(long) err);
#endif
if (*ec) {
- Log("VUpdateVolume: error updating volume header, volume %u (%s)\n",
- V_id(vp), V_name(vp));
+ Log("VUpdateVolume: error updating volume header, volume %" AFS_VOLID_FMT " (%s)\n",
+ afs_printable_VolumeId_lu(V_id(vp)), V_name(vp));
/* try to update on-disk header,
* while preventing infinite recursion */
if (!(flags & VOL_UPDATE_NOFORCEOFF)) {
V_inUse(vp) = 0;
VUpdateVolume_r(&ec, vp, VOL_UPDATE_NOFORCEOFF);
if (ec) {
- Log("VCheckDetach: volume header update for volume %u "
- "failed with errno %d\n", vp->hashid, errno);
+ Log("VCheckDetach: volume header update for volume %" AFS_VOLID_FMT " "
+ "failed with errno %d\n", afs_printable_VolumeId_lu(vp->hashid), errno);
}
}
VReleaseVolumeHandles_r(vp);
V_inUse(vp) = 0;
VUpdateVolume_r(&ec, vp, VOL_UPDATE_NOFORCEOFF);
if (ec) {
- Log("VCheckDetach: volume header update for volume %u failed with errno %d\n",
- vp->hashid, errno);
+ Log("VCheckDetach: volume header update for volume %" AFS_VOLID_FMT " failed with errno %d\n",
+ afs_printable_VolumeId_lu(vp->hashid), errno);
}
}
VReleaseVolumeHandles_r(vp);
*ec = VSALVAGING;
} else {
- Log("VRequestSalvage: volume %u online salvaged too many times; forced offline.\n", vp->hashid);
+ Log("VRequestSalvage: volume %" AFS_VOLID_FMT " online salvaged too many times; forced offline.\n", afs_printable_VolumeId_lu(vp->hashid));
/* make sure neither VScheduleSalvage_r nor
* VUpdateSalvagePriority_r try to schedule another salvage */
try_SALVSYNC(Volume *vp, char *partName, int *code) {
#ifdef SALVSYNC_BUILD_CLIENT
if (VCanUseSALVSYNC()) {
- Log("Scheduling salvage for volume %lu on part %s over SALVSYNC\n",
- afs_printable_uint32_lu(vp->hashid), partName);
+ Log("Scheduling salvage for volume %" AFS_VOLID_FMT " on part %s over SALVSYNC\n",
+ afs_printable_VolumeId_lu(vp->hashid), partName);
/* can't use V_id() since there's no guarantee
* we have the disk data header at this point */
try_FSSYNC(Volume *vp, char *partName, int *code) {
#ifdef FSSYNC_BUILD_CLIENT
if (VCanUseFSSYNC()) {
- Log("Scheduling salvage for volume %lu on part %s over FSSYNC\n",
- afs_printable_uint32_lu(vp->hashid), partName);
+ Log("Scheduling salvage for volume %" AFS_VOLID_FMT " on part %s over FSSYNC\n",
+ afs_printable_VolumeId_lu(vp->hashid), partName);
/*
* If we aren't the fileserver, tell the fileserver the volume
break;
case SYNC_DENIED:
ret = VCHECK_SALVAGE_DENIED;
- Log("VScheduleSalvage_r: Salvage request for volume %lu "
- "denied\n", afs_printable_uint32_lu(vp->hashid));
+ Log("VScheduleSalvage_r: Salvage request for volume %" AFS_VOLID_FMT " "
+ "denied\n", afs_printable_VolumeId_lu(vp->hashid));
break;
case SYNC_FAILED:
ret = VCHECK_SALVAGE_FAIL;
- Log("VScheduleSalvage_r: Salvage request for volume %lu "
- "failed\n", afs_printable_uint32_lu(vp->hashid));
+ Log("VScheduleSalvage_r: Salvage request for volume %" AFS_VOLID_FMT " "
+ "failed\n", afs_printable_VolumeId_lu(vp->hashid));
break;
default:
ret = VCHECK_SALVAGE_FAIL;
- Log("VScheduleSalvage_r: Salvage request for volume %lu "
+ Log("VScheduleSalvage_r: Salvage request for volume %" AFS_VOLID_FMT " "
"received unknown protocol error %d\n",
- afs_printable_uint32_lu(vp->hashid), code);
+ afs_printable_VolumeId_lu(vp->hashid), code);
break;
}
*
*/
void
-VGetVolumePath(Error * ec, VolId volumeId, char **partitionp, char **namep)
+VGetVolumePath(Error * ec, VolumeId volumeId, char **partitionp, char **namep)
{
static char partition[VMAXPATHLEN], name[VMAXPATHLEN];
char path[VMAXPATHLEN];
*ec = 0;
name[0] = OS_DIRSEPC;
snprintf(&name[1], (sizeof name) - 1, VFORMAT,
- afs_printable_uint32_lu(volumeId));
+ afs_printable_VolumeId_lu(volumeId));
for (dp = DiskPartitionList; dp; dp = dp->next) {
struct afs_stat_st status;
strcpy(path, VPartitionPath(dp));
VolumeExternalName(VolumeId volumeId)
{
static char name[VMAXPATHLEN];
- snprintf(name, sizeof name, VFORMAT, afs_printable_uint32_lu(volumeId));
+ snprintf(name, sizeof name, VFORMAT, afs_printable_VolumeId_lu(volumeId));
return name;
}
int
VolumeExternalName_r(VolumeId volumeId, char * name, size_t len)
{
- return snprintf(name, len, VFORMAT, afs_printable_uint32_lu(volumeId));
+ return snprintf(name, len, VFORMAT, afs_printable_VolumeId_lu(volumeId));
}
* asynchronous hash chain reordering to finish.
*/
static void
-AddVolumeToHashTable(Volume * vp, int hashid)
+AddVolumeToHashTable(Volume * vp, VolumeId hashid)
{
VolumeHashChainHead * head;
* hint volume object.
*/
Volume *
-VLookupVolume_r(Error * ec, VolId volumeId, Volume * hint)
+VLookupVolume_r(Error * ec, VolumeId volumeId, Volume * hint)
{
int looks = 0;
Volume * vp, *np;
* occurred while the volume was on line. */
bit32 uniquifier; /* Next vnode uniquifier for this volume */
int type; /* */
- VolId parentId; /* Id of parent, if type==readonly */
- VolId cloneId; /* Latest read-only clone, if type==readwrite,
+ VolumeId parentId; /* Id of parent, if type==readonly */
+ VolumeId cloneId; /* Latest read-only clone, if type==readwrite,
* 0 if the volume has never been cloned. Note: the
* indicated volume does not necessarily exist (it
* may have been deleted since cloning). */
- VolId backupId; /* Latest backup copy of this read write volume */
- VolId restoredFromId; /* The id in the dump this volume was restored from--used simply
+ VolumeId backupId; /* Latest backup copy of this read write volume */
+ VolumeId restoredFromId; /* The id in the dump this volume was restored from--used simply
* to make sure that an incremental dump is not restored on top
* of something inappropriate: Note: this field itself is NEVER
* dumped!!! */
extern char *VSalvageMessage; /* Canonical message when a volume is forced
* offline */
-extern Volume *VGetVolume(Error * ec, Error * client_ec, VolId volumeId);
-extern Volume *VGetVolumeWithCall(Error * ec, Error * client_ec, VolId volumeId,
+extern Volume *VGetVolume(Error * ec, Error * client_ec, VolumeId volumeId);
+extern Volume *VGetVolumeWithCall(Error * ec, Error * client_ec, VolumeId volumeId,
const struct timespec *ts, struct VCallByVol *cbv);
-extern Volume *VGetVolume_r(Error * ec, VolId volumeId);
+extern Volume *VGetVolume_r(Error * ec, VolumeId volumeId);
extern void VPutVolume(Volume *);
extern void VPutVolumeWithCall(Volume *vp, struct VCallByVol *cbv);
extern void VPutVolume_r(Volume *);
extern int VChildProcReconnectFS(void);
extern Volume *VAttachVolume(Error * ec, VolumeId volumeId, int mode);
extern Volume *VAttachVolume_r(Error * ec, VolumeId volumeId, int mode);
-extern Volume *VCreateVolume(Error * ec, char *partname, VolId volumeId,
- VolId parentId);
-extern Volume *VCreateVolume_r(Error * ec, char *partname, VolId volumeId,
- VolId parentId);
+extern Volume *VCreateVolume(Error * ec, char *partname, VolumeId volumeId,
+ VolumeId parentId);
+extern Volume *VCreateVolume_r(Error * ec, char *partname, VolumeId volumeId,
+ VolumeId parentId);
extern void VGrowBitmap(struct vnodeIndex *index);
extern int VAllocBitmapEntry(Error * ec, Volume * vp,
struct vnodeIndex *index);
extern void AssignVolumeName(VolumeDiskData * vol, char *name, char *ext);
extern void VTakeOffline_r(Volume * vp);
extern void VTakeOffline(Volume * vp);
-extern Volume * VLookupVolume_r(Error * ec, VolId volumeId, Volume * hint);
-extern void VGetVolumePath(Error * ec, VolId volumeId, char **partitionp,
+extern Volume * VLookupVolume_r(Error * ec, VolumeId volumeId, Volume * hint);
+extern void VGetVolumePath(Error * ec, VolumeId volumeId, char **partitionp,
char **namep);
extern char *vol_DevName(dev_t adev, char *wpath);
extern afs_int32 VIsGoingOffline(struct Volume *vp);
extern Volume *VPreAttachVolumeByName(Error * ec, char *partition, char *name);
extern Volume *VPreAttachVolumeByName_r(Error * ec, char *partition, char *name);
extern Volume *VPreAttachVolumeById_r(Error * ec, char * partition,
- VolId volumeId);
+ VolumeId volumeId);
extern Volume *VPreAttachVolumeByVp_r(Error * ec, struct DiskPartition64 * partp,
- Volume * vp, VolId volume_id);
+ Volume * vp, VolumeId volume_id);
extern Volume *VGetVolumeByVp_r(Error * ec, Volume * vp);
extern int VShutdownByPartition_r(struct DiskPartition64 * dp);
extern int VShutdownVolume_r(Volume * vp);
#define V_pref(vp,nearInode) nearInode = 0
#endif /* NEARINODE_HINT */
-hdr_static_inline(unsigned int)
-afs_printable_VolumeId_u(VolumeId d) { return (unsigned int) d; }
+hdr_static_inline(unsigned long)
+afs_printable_VolumeId_lu(VolumeId d) { return (unsigned long) (d); }
hdr_static_inline(unsigned int)
afs_printable_VnodeId_u(VnodeId d) { return (unsigned int) d; }
}
Volume *
-VCreateVolume(Error * ec, char *partname, VolId volumeId, VolId parentId)
+VCreateVolume(Error * ec, char *partname, VolumeId volumeId, VolumeId parentId)
{ /* Should be the same as volumeId if there is
* no parent */
Volume *retVal;
}
Volume *
-VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId)
+VCreateVolume_r(Error * ec, char *partname, VolumeId volumeId, VolumeId parentId)
{ /* Should be the same as volumeId if there is
* no parent */
VolumeDiskData vol;
vol.stamp.version = VOLUMEINFOVERSION;
vol.destroyMe = DESTROY_ME;
snprintf(headerName, sizeof headerName, VFORMAT,
- afs_printable_uint32_lu(vol.id));
+ afs_printable_VolumeId_lu(vol.id));
snprintf(volumePath, sizeof volumePath, "%s" OS_DIRSEP "%s",
VPartitionPath(partition), headerName);
rc = stat(volumePath, &st);
rc = VCreateVolumeDiskHeader(&diskHeader, partition);
if (rc) {
Log("VCreateVolume: Error %d trying to write volume header for "
- "volume %u on partition %s; volume not created\n", rc,
- vol.id, VPartitionPath(partition));
+ "volume %" AFS_VOLID_FMT " on partition %s; volume not created\n", rc,
+ afs_printable_VolumeId_lu(vol.id), VPartitionPath(partition));
if (rc == EEXIST) {
*ec = VVOLEXISTS;
}
char path[MAXPATHLEN];
snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
- VPartitionPath(dp), afs_printable_uint32_lu(volid));
+ VPartitionPath(dp), afs_printable_VolumeId_lu(volid));
fd = open(path, O_RDONLY);
if (fd < 0) {
- Log("VReadVolumeDiskHeader: Couldn't open header for volume %lu (errno %d).\n",
- afs_printable_uint32_lu(volid), errno);
+ Log("VReadVolumeDiskHeader: Couldn't open header for volume %" AFS_VOLID_FMT " (errno %d).\n",
+ afs_printable_VolumeId_lu(volid), errno);
code = -1;
} else if (hdr && read(fd, hdr, sizeof(*hdr)) != sizeof(*hdr)) {
- Log("VReadVolumeDiskHeader: Couldn't read header for volume %lu.\n",
- afs_printable_uint32_lu(volid));
+ Log("VReadVolumeDiskHeader: Couldn't read header for volume %" AFS_VOLID_FMT ".\n",
+ afs_printable_VolumeId_lu(volid));
code = EIO;
}
flags |= O_RDWR;
snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
- VPartitionPath(dp), afs_printable_uint32_lu(hdr->id));
+ VPartitionPath(dp), afs_printable_VolumeId_lu(hdr->id));
fd = open(path, flags, 0644);
if (fd < 0) {
code = errno;
#endif /* AFS_DEMAND_ATTACH_FS */
snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
- VPartitionPath(dp), afs_printable_uint32_lu(volid));
+ VPartitionPath(dp), afs_printable_VolumeId_lu(volid));
code = unlink(path);
if (code) {
Log("VDestroyVolumeDiskHeader: Couldn't unlink disk header, error = %d\n", errno);
}
code = FSYNC_VGCDel(dp->name, parent, volid, FSYNC_WHATEVER, &res);
if (code) {
- Log("VDestroyVolumeDiskHeader: FSYNC_VGCDel(%s, %lu, %lu) failed "
+ Log("VDestroyVolumeDiskHeader: FSYNC_VGCDel(%s, %" AFS_VOLID_FMT ", %" AFS_VOLID_FMT ") failed "
"with code %ld reason %ld\n", dp->name,
- afs_printable_uint32_lu(parent),
- afs_printable_uint32_lu(volid),
+ afs_printable_VolumeId_lu(parent),
+ afs_printable_VolumeId_lu(volid),
afs_printable_int32_ld(code),
afs_printable_int32_ld(res.hdr.reason));
}
#include <afs/cellconfig.h>
#include <afs/cmd.h>
#include <afs/vlserver.h>
+#include <afs/afsint.h>
#include "volser.h"
#endif
* The handle needs to be dereferenced with the FidZap() routine.
*/
void
-SetSalvageDirHandle(DirHandle * dir, afs_uint32 volume, afs_int32 device,
+SetSalvageDirHandle(DirHandle * dir, VolumeId volume, afs_int32 device,
Inode inode)
{
private int SalvageCacheCheck = 1;
#define _VOLSER_PHYSIO_H
/* physio.c */
-extern void SetSalvageDirHandle(DirHandle *, afs_uint32, afs_int32, Inode);
+extern void SetSalvageDirHandle(DirHandle *, VolumeId, afs_int32, Inode);
extern void FidZap(DirHandle *);
#endif
fdP = IH_OPEN(vol->vnodeIndex[class].handle);
if (!fdP) {
- sprintf(m->line, "Couldn't open %s Index of volume %u\n",
- class ? "small":"large", V_id(vol));
+ sprintf(m->line, "Couldn't open %s Index of volume %" AFS_VOLID_FMT "\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)));
rx_Write(m->call, m->line, strlen(m->line));
code = EIO;
goto Bad_Extract;
}
stream = FDH_FDOPEN(fdP, "r");
if (!stream) {
- sprintf(m->line, "Couldn't stream open %s Index of volume %u\n",
- class ? "small":"large", V_id(vol));
+ sprintf(m->line, "Couldn't stream open %s Index of volume %" AFS_VOLID_FMT "\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)));
rx_Write(m->call, m->line, strlen(m->line));
code = EIO;
goto Bad_Extract;
}
}
if (m->verbose) {
- sprintf(m->line, "Volume %u has %u %s vnodes in volume %u\n",
- V_parentId(vol), *length, class? "small":"large",
- V_id(vol));
+ sprintf(m->line, "Volume %" AFS_VOLID_FMT " has %u %s vnodes in volume %" AFS_VOLID_FMT "\n",
+ afs_printable_VolumeId_lu(V_parentId(vol)), *length,
+ class? "small":"large", afs_printable_VolumeId_lu(V_id(vol)));
rx_Write(m->call, m->line, strlen(m->line));
}
infdP = IH_OPEN(inh);
if (!infdP) {
- sprintf(m->line, "Couldn't open input directory %u.%u.%u\n",
- infdP->fd_ih->ih_vid,
- (afs_uint32)(infdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
- (afs_uint32)(infdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
+ sprintf(m->line, "Couldn't open input directory %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(infdP->fd_ih->ih_vid),
+ (afs_uint32)(infdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
+ (afs_uint32)(infdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
rx_Write(m->call, m->line, strlen(m->line));
return EIO;
}
FDH_REALLYCLOSE(outfdP);
outfdP = IH_OPEN(outh);
if (!outfdP) {
- sprintf(m->line, "Couldn't open output directory %u.%u.%u\n",
- outfdP->fd_ih->ih_vid,
- (afs_uint32)(outfdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
- (afs_uint32)(outfdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
+ sprintf(m->line, "Couldn't open output directory %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(outfdP->fd_ih->ih_vid),
+ (afs_uint32)(outfdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
+ (afs_uint32)(outfdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
rx_Write(m->call, m->line, strlen(m->line));
FDH_REALLYCLOSE(infdP);
return EIO;
size_t tlen;
tlen = size > 2048 ? 2048 : size;
if (FDH_PREAD(infdP, tbuf, tlen, offset) != tlen) {
- sprintf(m->line, "Couldn't read directory %u.%u.%u\n",
- infdP->fd_ih->ih_vid,
+ sprintf(m->line, "Couldn't read directory %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(infdP->fd_ih->ih_vid),
(afs_uint32)(infdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
(afs_uint32)(infdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
rx_Write(m->call, m->line, strlen(m->line));
return EIO;
}
if (FDH_PWRITE(outfdP, tbuf, tlen, offset) != tlen) {
- sprintf(m->line, "Couldn't write directory %u.%u.%u\n",
- outfdP->fd_ih->ih_vid,
+ sprintf(m->line, "Couldn't write directory %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(outfdP->fd_ih->ih_vid),
(afs_uint32)(outfdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
(afs_uint32)(outfdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
rx_Write(m->call, m->line, strlen(m->line));
fdP = IH_OPEN(vol->vnodeIndex[class].handle);
if (!fdP) {
- Log("Couldn't open %s Index of volume %u\n",
- class ? "small":"large", V_id(vol));
+ Log("Couldn't open %s Index of volume %" AFS_VOLID_FMT "\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)));
code = EIO;
goto Bad_Copy;
}
newfdP = IH_OPEN(newvol->vnodeIndex[class].handle);
if (!newfdP) {
- Log("Couldn't open %s Index of volume %u\n",
- class ? "small":"large", V_id(newvol));
+ Log("Couldn't open %s Index of volume %" AFS_VOLID_FMT "\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(newvol)));
code = EIO;
goto Bad_Copy;
}
afs_uint64 size;
offset = (e->vN + 1 - class) << (vcp->logSize -1);
if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't read in %s Index of volume %u at offset %llu\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't read in %s Index of volume %" AFS_VOLID_FMT " at offset %llu\n",
+ class ? "small":"large",
+ afs_printable_VolumeId_lu(V_id(vol)), offset);
code = EIO;
goto Bad_Copy;
}
VNDISK_SET_INO(vnode, newino);
vnode->cloned = 0;
if (FDH_PWRITE(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u at offset %llu\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't write in %s Index of volume %" AFS_VOLID_FMT " at offset %llu\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)), offset);
code = EIO;
goto Bad_Copy;
}
e->vN, vnode->uniquifier,
vnode->dataVersion);
if (!VALID_INO(newino)) {
- Log("IH_CREATE failed for %u.%u.%u\n",
- V_id(newvol), e->vN, vnode->uniquifier);
+ Log("IH_CREATE failed for %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(V_id(newvol)), e->vN, vnode->uniquifier);
code = EIO;
goto Bad_Copy;
}
vnode->parent = 1; /* in new root-directory */
vnode->cloned = 0;
if (FDH_PWRITE(newfdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u to offset %llu\n",
- class ? "small":"large", V_id(newvol), offset);
+ Log("Couldn't write in %s Index of volume %" AFS_VOLID_FMT " to offset %llu\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(newvol)), offset);
code = EIO;
goto Bad_Copy;
}
newoffset = vcp->diskSize;
if (FDH_PREAD(newfdP, vnode2, vcp->diskSize, newoffset) != vcp->diskSize) {
- Log("splitvolume: couldn't read in large Index of new volume %u at offset %u\n",
- V_id(newvol), vcp->diskSize);
+ Log("splitvolume: couldn't read in large Index of new volume %" AFS_VOLID_FMT " at offset %u\n",
+ afs_printable_VolumeId_lu(V_id(newvol)), vcp->diskSize);
code = EIO;
goto Bad_Copy;
}
offset = (where + 1 - class) << (vcp->logSize -1);
if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't read in large Index of old volume %u at offset %llu\n",
- V_id(vol), offset);
+ Log("Couldn't read in large Index of old volume %" AFS_VOLID_FMT " at offset %llu\n",
+ afs_printable_VolumeId_lu(V_id(vol)), offset);
code = EIO;
goto Bad_Copy;
}
code = copyDir(m, h, newh);
if (code) {
Log("splitvolume: copyDir failed for new root from "
- "%u.%u.%u to %u.1.1\n",
- V_id(vol), where, vnode->uniquifier, V_id(newvol));
+ "%" AFS_VOLID_FMT ".%u.%u to %" AFS_VOLID_FMT ".1.1\n",
+ afs_printable_VolumeId_lu(V_id(vol)), where, vnode->uniquifier,
+ afs_printable_VolumeId_lu(V_id(newvol)));
code = EIO;
goto Bad_Copy;
}
vnode->parent = vnode2->parent;
vnode->serverModifyTime = vnode2->serverModifyTime;
if (FDH_PWRITE(newfdP, vnode, vcp->diskSize, newoffset) != vcp->diskSize) {
- Log("splitvolume: couldn't write in large Index of %u at offset %u\n",
- V_id(newvol), vcp->diskSize);
+ Log("splitvolume: couldn't write in large Index of %" AFS_VOLID_FMT " at offset %u\n",
+ afs_printable_VolumeId_lu(V_id(newvol)), vcp->diskSize);
code = EIO;
}
}
FT_GetTimeOfDay(&now, 0);
fdP = IH_OPEN(vol->vnodeIndex[vSmall].handle);
if (!fdP) {
- Log("split volume: error opening small vnode index of %u\n", V_id(vol));
+ Log("split volume: error opening small vnode index of %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(V_id(vol)));
return EIO;
}
offset = vcp->diskSize;
rc = FDH_PREAD(fdP, &vnode, vcp->diskSize, offset);
if (rc != vcp->diskSize) {
if (rc < 0) {
- Log("split volume: error reading small vnode index of %u\n", V_id(vol));
+ Log("split volume: error reading small vnode index of %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(V_id(vol)));
return EIO;
}
if (rc == 0)
IH_INIT(h, V_device(vol), V_parentId(vol), newino);
fdP2 = IH_OPEN(h);
if (!fdP2) {
- Log("split volume: couldn't open inode for mountpoint %u.%u.%u\n",
- V_id(vol), newvN, vnode.uniquifier);
+ Log("split volume: couldn't open inode for mountpoint %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(V_id(vol)), newvN, vnode.uniquifier);
return EIO;
}
sprintf(symlink, "#%s", V_name(newvol));
size = strlen(symlink) + 1;
if (FDH_PWRITE(fdP2, symlink, size, 0) != size) {
- Log("split volume: couldn't write mountpoint %u.%u.%u\n",
- V_id(vol), newvN, vnode.uniquifier);
+ Log("split volume: couldn't write mountpoint %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(V_id(vol)), newvN, vnode.uniquifier);
return EIO;
}
FDH_REALLYCLOSE(fdP2);
vnode.vnodeMagic = SMALLVNODEMAGIC;
#endif
if (FDH_PWRITE(fdP, &vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("split volume: couldn't write vnode for mountpoint %u.%u.%u\n",
- V_id(vol), newvN, vnode.uniquifier);
+ Log("split volume: couldn't write vnode for mountpoint %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(V_id(vol)), newvN, vnode.uniquifier);
return EIO;
}
FDH_REALLYCLOSE(fdP);
code = afs_dir_Delete(&dir, name);
if (code) {
- Log("splitvolume: couldn't delete directory entry for %s in %u.%u.%u, code = %d\n",
- name, V_id(vol), vN, parent->uniquifier, code);
+ Log("splitvolume: couldn't delete directory entry for %s in %" AFS_VOLID_FMT ".%u.%u, code = %d\n",
+ name, afs_printable_VolumeId_lu(V_id(vol)), vN, parent->uniquifier, code);
return code;
}
code = afs_dir_Create(&dir, name, &fid);
offset = (vN + 1 - class) << (vcp->logSize -1);
parent->dataVersion++;
if (FDH_PWRITE(fdP, parent, vcp->diskSize, offset) != vcp->diskSize) {
- Log("split volume: couldn't write vnode for parent directory %u.%u.%u\n",
- V_id(vol), vN, parent->uniquifier);
+ Log("split volume: couldn't write vnode for parent directory %" AFS_VOLID_FMT ".%u.%u\n",
+ afs_printable_VolumeId_lu(V_id(vol)), vN, parent->uniquifier);
return EIO;
}
FDH_REALLYCLOSE(fdP);
fdP = IH_OPEN(vol->vnodeIndex[class].handle);
if (!fdP) {
- Log("Couldn't open %s Index of volume %u\n",
- class ? "small":"large", V_id(vol));
+ Log("Couldn't open %s Index of volume %" AFS_VOLID_FMT "\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)));
code = EIO;
goto Bad_Delete;
}
if (e->flag & NEEDED) {
offset = (e->vN + 1 - class) << (vcp->logSize -1);
if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't read in %s Index of volume %u at offset %llu\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't read in %s Index of volume %" AFS_VOLID_FMT " at offset %llu\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)), offset);
code = EIO;
goto Bad_Delete;
}
memset(vnode, 0, vcp->diskSize);
vnode->type = vNull;
if (FDH_PWRITE(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u to offset %llu\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't write in %s Index of volume %" AFS_VOLID_FMT " to offset %llu\n",
+ class ? "small":"large", afs_printable_VolumeId_lu(V_id(vol)), offset);
}
}
}
&parent, parVnode);
if (code) {
sprintf(m->line,
- "ExtractVnodes failed for %u for directories with code %d\n",
- V_id(vol), code);
+ "ExtractVnodes failed for %" AFS_VOLID_FMT " for directories with code %d\n",
+ afs_printable_VolumeId_lu(V_id(vol)), code);
rx_Write(m->call, m->line, strlen(m->line));
return code;
}
if (verbose) {
- sprintf(m->line, "2nd step: look for name of vnode %u in directory %u.%u.%u\n",
- where, V_id(vol), parent, parVnode->uniquifier);
+ sprintf(m->line, "2nd step: look for name of vnode %u in directory %" AFS_VOLID_FMT ".%u.%u\n",
+ where, afs_printable_VolumeId_lu(V_id(vol)), parent, parVnode->uniquifier);
rx_Write(m->call, m->line, strlen(m->line));
}
code = findName(vol, parVnode, where, rootVnode->uniquifier,
name, sizeof(name));
if (code) {
sprintf(m->line,
- "splitvolume: could'nt find name of %u in directory %u.%u.%u.\n",
- where, V_id(vol), parent, parVnode->uniquifier);
+ "splitvolume: could'nt find name of %u in directory %" AFS_VOLID_FMT ".%u.%u.\n",
+ where, afs_printable_VolumeId_lu(V_id(vol)), parent, parVnode->uniquifier);
rx_Write(m->call, m->line, strlen(m->line));
return code;
}
code = ExtractVnodes(m, vol, vSmall, &fileList, &fl, where, 0, 0, 0);
if (code) {
sprintf(m->line,
- "ExtractVnodes failed for %u for files with code %d\n",
- V_id(vol), code);
+ "ExtractVnodes failed for %" AFS_VOLID_FMT " for files with code %d\n",
+ afs_printable_VolumeId_lu(V_id(vol)), code);
rx_Write(m->call, m->line, strlen(m->line));
return code;
}
afs_int32, afs_uint32, afs_uint32 *,
afs_int32 *);
static afs_int32 VolDeleteVolume(struct rx_call *, afs_int32);
-static afs_int32 VolClone(struct rx_call *, afs_int32, afs_uint32,
- afs_int32, char *, afs_uint32 *);
-static afs_int32 VolReClone(struct rx_call *, afs_int32, afs_int32);
-static afs_int32 VolTransCreate(struct rx_call *, afs_uint32, afs_int32,
+static afs_int32 VolClone(struct rx_call *, afs_int32, VolumeId,
+ afs_int32, char *, VolumeId *);
+static afs_int32 VolReClone(struct rx_call *, afs_int32, VolumeId);
+static afs_int32 VolTransCreate(struct rx_call *, VolumeId, afs_int32,
afs_int32, afs_int32 *);
static afs_int32 VolGetNthVolume(struct rx_call *, afs_int32, afs_uint32 *,
afs_int32 *);
static afs_int32 VolGetName(struct rx_call *, afs_int32, char **);
static afs_int32 VolListPartitions(struct rx_call *, struct pIDs *);
static afs_int32 XVolListPartitions(struct rx_call *, struct partEntries *);
-static afs_int32 VolListOneVolume(struct rx_call *, afs_int32, afs_uint32,
+static afs_int32 VolListOneVolume(struct rx_call *, afs_int32, VolumeId,
volEntries *);
-static afs_int32 VolXListOneVolume(struct rx_call *, afs_int32, afs_uint32,
+static afs_int32 VolXListOneVolume(struct rx_call *, afs_int32, VolumeId,
volXEntries *);
static afs_int32 VolListVolumes(struct rx_call *, afs_int32, afs_int32,
volEntries *);
volXEntries *);
static afs_int32 VolMonitor(struct rx_call *, transDebugEntries *);
static afs_int32 VolSetIdsTypes(struct rx_call *, afs_int32, char [],
- afs_int32, afs_uint32, afs_uint32,
- afs_uint32);
+ afs_int32, VolumeId, VolumeId,
+ VolumeId);
static afs_int32 VolSetDate(struct rx_call *, afs_int32, afs_int32);
/**
}
static int
-ConvertVolume(afs_uint32 avol, char *aname, afs_int32 asize)
+ConvertVolume(VolumeId avol, char *aname, afs_int32 asize)
{
if (asize < 18)
return -1;
/* It's better using the Generic VFORMAT since otherwise we have to make changes to too many places... The 14 char limitation in names hits us again in AIX; print in field of 9 digits (still 10 for the rest), right justified with 0 padding */
- snprintf(aname, asize, VFORMAT, (unsigned long)avol);
+ snprintf(aname, asize, VFORMAT, afs_printable_VolumeId_lu(avol));
return 0;
}
/* obliterate a volume completely, and slowly. */
afs_int32
-SAFSVolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_uint32 avolID)
+SAFSVolNukeVolume(struct rx_call *acid, afs_int32 apartID, VolumeId avolID)
{
afs_int32 code;
*/
afs_int32
SAFSVolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname,
- afs_int32 atype, afs_uint32 aparent, afs_uint32 *avolid,
+ afs_int32 atype, VolumeId aparent, VolumeId *avolid,
afs_int32 *atrans)
{
afs_int32 code;
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: Delete: volume %u already deleted \n", tt->volid);
+ Log("1 Volser: Delete: volume %" AFS_VOLID_FMT " already deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (DoLogging) {
char buffer[16];
- Log("%s on %s is executing Delete Volume %u\n", caller,
- callerAddress(acid, buffer), tt->volid);
+ Log("%s on %s is executing Delete Volume %" AFS_VOLID_FMT "\n", caller,
+ callerAddress(acid, buffer), afs_printable_VolumeId_lu(tt->volid));
}
TSetRxCall(tt, acid, "DeleteVolume");
VPurgeVolume(&error, tt->volume); /* don't check error code, it is not set! */
if (TRELE(tt))
return VOLSERTRELE_ERROR;
- Log("1 Volser: Delete: volume %u deleted \n", tt->volid);
+ Log("1 Volser: Delete: volume %" AFS_VOLID_FMT " deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
return 0; /* vpurgevolume doesn't set an error code */
}
*/
/* for efficiency reasons, sometimes faster to piggyback a purge here */
afs_int32
-SAFSVolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
- afs_int32 newType, char *newName, afs_uint32 *newNumber)
+SAFSVolClone(struct rx_call *acid, afs_int32 atrans, VolumeId purgeId,
+ afs_int32 newType, char *newName, VolumeId *newNumber)
{
afs_int32 code;
-
code = VolClone(acid, atrans, purgeId, newType, newName, newNumber);
osi_auditU(acid, VS_CloneEvent, code, AUD_LONG, atrans, AUD_LONG, purgeId,
AUD_STR, newName, AUD_LONG, newType, AUD_LONG, *newNumber,
}
static afs_int32
-VolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
- afs_int32 newType, char *newName, afs_uint32 *newNumber)
+VolClone(struct rx_call *acid, afs_int32 atrans, VolumeId purgeId,
+ afs_int32 newType, char *newName, VolumeId *newNumber)
{
- afs_uint32 newId;
+ VolumeId newId;
struct Volume *originalvp, *purgevp, *newvp;
Error error, code;
struct volser_trans *tt, *ttc;
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: Clone: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: Clone: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (purgeId) {
purgevp = VAttachVolume_retry(&error, purgeId, V_VOLUPD);
if (error) {
- Log("1 Volser: Clone: Could not attach 'purge' volume %u; clone aborted\n", purgeId);
+ Log("1 Volser: Clone: Could not attach 'purge' volume %" AFS_VOLID_FMT "; clone aborted\n", afs_printable_VolumeId_lu(purgeId));
goto fail;
}
} else {
}
originalvp = tt->volume;
if ((V_destroyMe(originalvp) == DESTROY_ME) || !V_inService(originalvp)) {
- Log("1 Volser: Clone: Volume %d is offline and cannot be cloned\n",
- V_id(originalvp));
+ Log("1 Volser: Clone: Volume %" AFS_VOLID_FMT " is offline and cannot be cloned\n",
+ afs_printable_VolumeId_lu(V_id(originalvp)));
error = VOFFLINE;
goto fail;
}
if (purgevp) {
if (originalvp->device != purgevp->device) {
- Log("1 Volser: Clone: Volumes %u and %u are on different devices\n", tt->volid, purgeId);
+ Log("1 Volser: Clone: Volumes %" AFS_VOLID_FMT " and %" AFS_VOLID_FMT " are on different devices\n", afs_printable_VolumeId_lu(tt->volid), afs_printable_VolumeId_lu(purgeId));
error = EXDEV;
goto fail;
}
goto fail;
}
if (V_parentId(originalvp) != V_parentId(purgevp)) {
- Log("1 Volser: Clone: Volume %u and volume %u were not originally cloned from the same parent; aborted\n", purgeId, tt->volid);
+ Log("1 Volser: Clone: Volume %" AFS_VOLID_FMT " and volume %" AFS_VOLID_FMT " were not originally cloned from the same parent; aborted\n", afs_printable_VolumeId_lu(purgeId), afs_printable_VolumeId_lu(tt->volid));
error = EXDEV;
goto fail;
}
}
if (newType == readonlyVolume)
V_cloneId(originalvp) = newId;
- Log("1 Volser: Clone: Cloning volume %u to new volume %u\n", tt->volid,
- newId);
+ Log("1 Volser: Clone: Cloning volume %" AFS_VOLID_FMT " to new volume %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(tt->volid),
+ afs_printable_VolumeId_lu(newId));
if (purgevp)
- Log("1 Volser: Clone: Purging old read only volume %u\n", purgeId);
+ Log("1 Volser: Clone: Purging old read only volume %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(purgeId));
CloneVolume(&error, originalvp, newvp, purgevp);
purgevp = NULL; /* clone releases it, maybe even if error */
if (error) {
/* reclone this volume into the specified id */
afs_int32
-SAFSVolReClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 cloneId)
+SAFSVolReClone(struct rx_call *acid, afs_int32 atrans, VolumeId cloneId)
{
afs_int32 code;
}
static afs_int32
-VolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId)
+VolReClone(struct rx_call *acid, afs_int32 atrans, VolumeId cloneId)
{
struct Volume *originalvp, *clonevp;
Error error, code;
return VOLSERBAD_ACCESS;
if (DoLogging) {
char buffer[16];
- Log("%s on %s is executing Reclone Volume %u\n", caller,
- callerAddress(acid, buffer), cloneId);
+ Log("%s on %s is executing Reclone Volume %" AFS_VOLID_FMT "\n", caller,
+ callerAddress(acid, buffer), afs_printable_VolumeId_lu(cloneId));
}
error = 0;
clonevp = originalvp = (Volume *) 0;
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolReClone: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolReClone: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
originalvp = tt->volume;
if ((V_destroyMe(originalvp) == DESTROY_ME) || !V_inService(originalvp)) {
- Log("1 Volser: Clone: Volume %d is offline and cannot be cloned\n",
- V_id(originalvp));
+ Log("1 Volser: Clone: Volume %" AFS_VOLID_FMT " is offline and cannot be cloned\n",
+ afs_printable_VolumeId_lu(V_id(originalvp)));
error = VOFFLINE;
goto fail;
}
clonevp = VAttachVolume_retry(&error, cloneId, V_VOLUPD);
if (error) {
- Log("1 Volser: can't attach clone %d\n", cloneId);
+ Log("1 Volser: can't attach clone %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(cloneId));
goto fail;
}
newType = V_type(clonevp); /* type of the new volume */
if (originalvp->device != clonevp->device) {
- Log("1 Volser: Clone: Volumes %u and %u are on different devices\n",
- tt->volid, cloneId);
+ Log("1 Volser: Clone: Volumes %" AFS_VOLID_FMT " and %" AFS_VOLID_FMT " are on different devices\n",
+ afs_printable_VolumeId_lu(tt->volid), afs_printable_VolumeId_lu(cloneId));
error = EXDEV;
goto fail;
}
if (V_parentId(originalvp) != V_parentId(clonevp)) {
- Log("1 Volser: Clone: Volume %u was not originally cloned from volume %u; aborted\n", cloneId, tt->volid);
+ Log("1 Volser: Clone: Volume %" AFS_VOLID_FMT " was not originally cloned from volume %" AFS_VOLID_FMT "; aborted\n", afs_printable_VolumeId_lu(cloneId), afs_printable_VolumeId_lu(tt->volid));
error = EXDEV;
goto fail;
}
}
error = 0;
- Log("1 Volser: Clone: Recloning volume %u to volume %u\n", tt->volid,
- cloneId);
+ Log("1 Volser: Clone: Recloning volume %" AFS_VOLID_FMT " to volume %" AFS_VOLID_FMT "\n", afs_printable_VolumeId_lu(tt->volid),
+ afs_printable_VolumeId_lu(cloneId));
CloneVolume(&error, originalvp, clonevp, clonevp);
if (error) {
Log("1 Volser: Clone: reclone operation failed with code %d\n",
* See volser.h for definition of iflags (the constants are named IT*).
*/
afs_int32
-SAFSVolTransCreate(struct rx_call *acid, afs_uint32 volume, afs_int32 partition,
+SAFSVolTransCreate(struct rx_call *acid, VolumeId volume, afs_int32 partition,
afs_int32 iflags, afs_int32 *ttid)
{
afs_int32 code;
}
static afs_int32
-VolTransCreate(struct rx_call *acid, afs_uint32 volume, afs_int32 partition,
+VolTransCreate(struct rx_call *acid, VolumeId volume, afs_int32 partition,
afs_int32 iflags, afs_int32 *ttid)
{
struct volser_trans *tt;
* Both the volume number and partition number (one-based) are returned.
*/
afs_int32
-SAFSVolGetNthVolume(struct rx_call *acid, afs_int32 aindex, afs_uint32 *avolume,
+SAFSVolGetNthVolume(struct rx_call *acid, afs_int32 aindex, VolumeId *avolume,
afs_int32 *apart)
{
afs_int32 code;
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolGetFlags: volume %u has been deleted \n",
- tt->volid);
+ Log("1 Volser: VolGetFlags: volume %" AFS_VOLID_FMT " has been deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolSetFlags: volume %u has been deleted \n",
- tt->volid);
+ Log("1 Volser: VolSetFlags: volume %" AFS_VOLID_FMT " has been deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolForward: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolForward: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolForward: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolForward: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolDump: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolDump: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolRestore: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolRestore: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolSetForwarding: volume %u has been deleted \n",
- tt->volid);
+ Log("1 Volser: VolSetForwarding: volume %" AFS_VOLID_FMT " has been deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolGetStatus: volume %u has been deleted \n",
- tt->volid);
+ Log("1 Volser: VolGetStatus: volume %" AFS_VOLID_FMT " has been deleted \n",
+ afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolSetInfo: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolSetInfo: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolGetName: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolGetName: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
* - a noop now !*/
afs_int32
SAFSVolSignalRestore(struct rx_call *acid, char volname[], int volType,
- afs_uint32 parentId, afs_uint32 cloneId)
+ VolumeId parentId, VolumeId cloneId)
{
return 0;
}
* false if we got to the end of the directory
*/
static int
-GetNextVol(DIR *dirp, char *volname, afs_uint32 *volid)
+GetNextVol(DIR *dirp, char *volname, VolumeId *volid)
{
struct dirent *dp;
* @internal
*/
static int
-GetVolObject(afs_uint32 volumeId, char * pname, Volume ** vp)
+GetVolObject(VolumeId volumeId, char * pname, Volume ** vp)
{
int code;
SYNC_response res;
*/
static int
GetVolInfo(afs_uint32 partId,
- afs_uint32 volumeId,
+ VolumeId volumeId,
char * pname,
char * volname,
volint_info_handle_t * handle,
}
if (error) {
- Log("1 Volser: GetVolInfo: Could not attach volume %u (%s:%s) error=%d\n",
- volumeId, pname, volname, error);
+ Log("1 Volser: GetVolInfo: Could not attach volume %" AFS_VOLID_FMT " (%s:%s) error=%d\n",
+ afs_printable_VolumeId_lu(volumeId), pname, volname, error);
goto drop;
}
goto drop;
case VOL_INFO_LIST_SINGLE:
- Log("1 Volser: GetVolInfo: Volume %u (%s:%s) will be destroyed on next salvage\n",
- volumeId, pname, volname);
+ Log("1 Volser: GetVolInfo: Volume %" AFS_VOLID_FMT " (%s:%s) will be destroyed on next salvage\n",
+ afs_printable_VolumeId_lu(volumeId), pname, volname);
default:
goto drop;
if (V_needsSalvaged(tv)) {
/*this volume will be salvaged */
- Log("1 Volser: GetVolInfo: Volume %u (%s:%s) needs to be salvaged\n",
- volumeId, pname, volname);
+ Log("1 Volser: GetVolInfo: Volume %" AFS_VOLID_FMT " (%s:%s) needs to be salvaged\n",
+ afs_printable_VolumeId_lu(volumeId), pname, volname);
}
#ifdef AFS_DEMAND_ATTACH_FS
if (error) {
VOLINT_INFO_STORE(handle, status, 0);
strcpy((char *)VOLINT_INFO_PTR(handle, name), volname);
- Log("1 Volser: GetVolInfo: Could not detach volume %u (%s:%s)\n",
- volumeId, pname, volname);
+ Log("1 Volser: GetVolInfo: Could not detach volume %" AFS_VOLID_FMT " (%s:%s)\n",
+ afs_printable_VolumeId_lu(volumeId), pname, volname);
}
}
if (ttc) {
/*return the header information about the <volid> */
afs_int32
SAFSVolListOneVolume(struct rx_call *acid, afs_int32 partid,
- afs_uint32 volumeId, volEntries *volumeInfo)
+ VolumeId volumeId, volEntries *volumeInfo)
{
afs_int32 code;
static afs_int32
VolListOneVolume(struct rx_call *acid, afs_int32 partid,
- afs_uint32 volumeId, volEntries *volumeInfo)
+ VolumeId volumeId, volEntries *volumeInfo)
{
struct DiskPartition64 *partP;
char pname[9], volname[20];
DIR *dirp;
- afs_uint32 volid;
+ VolumeId volid;
int found = 0;
int code;
volint_info_handle_t handle;
afs_int32
SAFSVolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
- afs_uint32 a_volID, volXEntries *a_volumeXInfoP)
+ VolumeId a_volID, volXEntries *a_volumeXInfoP)
{
afs_int32 code;
static afs_int32
VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
- afs_uint32 a_volID, volXEntries *a_volumeXInfoP)
+ VolumeId a_volID, volXEntries *a_volumeXInfoP)
{ /*SAFSVolXListOneVolume */
struct DiskPartition64 *partP; /*Ptr to partition */
char pname[9], volname[20]; /*Partition, volume names */
DIR *dirp; /*Partition directory ptr */
- afs_uint32 currVolID; /*Current volume ID */
+ VolumeId currVolID; /*Current volume ID */
int found = 0; /*Did we find the volume we need? */
int code;
volint_info_handle_t handle;
afs_int32 allocSize = 1000; /*to be changed to a larger figure */
char pname[9], volname[20];
DIR *dirp;
- afs_uint32 volid;
+ VolumeId volid;
int code;
volint_info_handle_t handle;
afs_int32 allocSize = 1000; /*To be changed to a larger figure */
char pname[9], volname[20]; /*Partition, volume names */
DIR *dirp; /*Partition directory ptr */
- afs_uint32 volid; /*Current volume ID */
+ VolumeId volid; /*Current volume ID */
int code;
volint_info_handle_t handle;
afs_int32
SAFSVolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[],
- afs_int32 type, afs_uint32 pId, afs_uint32 cloneId,
- afs_uint32 backupId)
+ afs_int32 type, afs_uint32 pId, VolumeId cloneId,
+ VolumeId backupId)
{
afs_int32 code;
static afs_int32
VolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[],
- afs_int32 type, afs_uint32 pId, afs_uint32 cloneId,
- afs_uint32 backupId)
+ afs_int32 type, VolumeId pId, VolumeId cloneId,
+ VolumeId backupId)
{
struct Volume *tv;
Error error = 0;
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolSetIds: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolSetIds: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
if (!tt)
return ENOENT;
if (tt->vflags & VTDeleted) {
- Log("1 Volser: VolSetDate: volume %u has been deleted \n", tt->volid);
+ Log("1 Volser: VolSetDate: volume %" AFS_VOLID_FMT " has been deleted \n", afs_printable_VolumeId_lu(tt->volid));
TRELE(tt);
return ENOENT;
}
afs_int32
SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
- afs_uint32 volumeId)
+ VolumeId volumeId)
{
#ifdef AFS_NT40_ENV
return EXDEV;
char pname[16], volname[20];
struct DiskPartition64 *partP;
afs_int32 ret = ENODEV;
- afs_uint32 volid;
+ VolumeId volid;
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS; /*not a super user */
afs_int32 creationTime; /* time the transaction started */
afs_int32 returnCode; /* transaction error code */
struct Volume *volume; /* pointer to open volume */
- afs_uint32 volid; /* open volume's id */
+ VolumeId volid; /* open volume's id */
afs_int32 partition; /* open volume's partition */
afs_int32 dumpTransId; /* other side's trans id during a dump */
afs_int32 dumpSeq; /* next sequence number to use during a dump */
/* voltrans.c */
extern struct volser_trans *FindTrans(afs_int32);
-extern struct volser_trans *NewTrans(afs_uint32, afs_int32);
+extern struct volser_trans *NewTrans(VolumeId, afs_int32);
extern struct volser_trans *TransList(void);
extern afs_int32 DeleteTrans(struct volser_trans *atrans, afs_int32 lock);
extern afs_int32 TRELE (struct volser_trans *);
/* create a new transaction, returning ptr to same with high ref count */
struct volser_trans *
-NewTrans(afs_uint32 avol, afs_int32 apart)
+NewTrans(VolumeId avol, afs_int32 apart)
{
/* set volid, next, partition */
struct volser_trans *tt, *newtt;
for (tt = allTrans; tt; tt = nt) {
nt = tt->next; /* remember in case we zap it */
if (tt->time + OLDTRANSWARN < now) {
- Log("trans %u on volume %u %s than %d seconds\n", tt->tid,
- tt->volid,
+ Log("trans %u on volume %" AFS_VOLID_FMT " %s than %d seconds\n", tt->tid,
+ afs_printable_VolumeId_lu(tt->volid),
((tt->refCount > 0) ? "is older" : "has been idle for more"),
(((now - tt->time) / GCWAKEUP) * GCWAKEUP));
}
if (tt->refCount > 0)
continue;
if (tt->time + OLDTRANSTIME < now) {
- Log("trans %u on volume %u has timed out\n", tt->tid, tt->volid);
+ Log("trans %u on volume %" AFS_VOLID_FMT " has timed out\n", tt->tid, afs_printable_VolumeId_lu(tt->volid));
tt->refCount++; /* we're using it now */