/* Forward Declarations */
void PrintHeader(register Volume * vp);
void HandleAllPart(void);
-void HandlePart(struct DiskPartition *partP);
-void HandleVolume(struct DiskPartition *partP, char *name);
-struct DiskPartition *FindCurrentPartition(void);
-Volume *AttachVolume(struct DiskPartition *dp, char *volname,
+void HandlePart(struct DiskPartition64 *partP);
+void HandleVolume(struct DiskPartition64 *partP, char *name);
+struct DiskPartition64 *FindCurrentPartition(void);
+Volume *AttachVolume(struct DiskPartition64 *dp, char *volname,
register struct VolumeHeader *header);
#if defined(AFS_NAMEI_ENV)
void PrintVnode(int offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
Volume *
-AttachVolume(struct DiskPartition * dp, char *volname,
+AttachVolume(struct DiskPartition64 * dp, char *volname,
register struct VolumeHeader * header)
{
register Volume *vp;
static int
-handleit(struct cmd_syndesc *as)
+handleit(struct cmd_syndesc *as, void *arock)
{
register struct cmd_item *ti;
int err = 0;
int volumeId = 0;
char *partName = 0;
- struct DiskPartition *partP = NULL;
+ struct DiskPartition64 *partP = NULL;
#ifndef AFS_NT40_ENV
if ((ti = as->parms[5].items))
partName = ti->data;
if ((ti = as->parms[6].items))
- volumeId = atoi(ti->data);
+ volumeId = strtoul(ti->data, NULL, 10);
if (as->parms[7].items)
dheader = 1;
else
#ifdef AFS_NT40_ENV
#include <direct.h>
-struct DiskPartition *
+struct DiskPartition64 *
FindCurrentPartition()
{
int dr = _getdrive();
- struct DiskPartition *dp;
+ struct DiskPartition64 *dp;
dr--;
for (dp = DiskPartitionList; dp; dp = dp->next) {
return dp;
}
#else
-struct DiskPartition *
+struct DiskPartition64 *
FindCurrentPartition()
{
char partName[1024];
char tmp = '\0';
char *p;
- struct DiskPartition *dp;
+ struct DiskPartition64 *dp;
if (!getcwd(partName, 1023)) {
perror("pwd");
void
HandleAllPart(void)
{
- struct DiskPartition *partP;
+ struct DiskPartition64 *partP;
for (partP = DiskPartitionList; partP; partP = partP->next) {
void
-HandlePart(struct DiskPartition *partP)
+HandlePart(struct DiskPartition64 *partP)
{
int nvols = 0;
DIR *dirp;
char *p = VPartitionPath(partP);
#endif
- if (chdir(p) == -1) {
- printf("Can't chdir to partition %s; giving up\n", p);
- exit(1);
- }
- if ((dirp = opendir(".")) == NULL) {
+ if ((dirp = opendir(p)) == NULL) {
printf("Can't read directory %s; giving up\n", p);
exit(1);
}
void
-HandleVolume(struct DiskPartition *dp, char *name)
+HandleVolume(struct DiskPartition64 *dp, char *name)
{
struct VolumeHeader header;
struct VolumeDiskHeader diskHeader;
printf("\tVolId\t= %u\n", header.id);
}
- IH_INIT(ih, dp->device, header.id, header.volumeInfo);
+ IH_INIT(ih, dp->device, header.parent, header.volumeInfo);
fdP = IH_OPEN(ih);
if (fdP == NULL) {
perror("opening volume info");
PrintInode(NULL, header.volumeInfo), code);
}
- IH_INIT(ih, dp->device, header.id, header.smallVnodeIndex);
+ IH_INIT(ih, dp->device, header.parent, header.smallVnodeIndex);
fdP = IH_OPEN(ih);
if (fdP == NULL) {
perror("opening small vnode index");
PrintInode(NULL, header.smallVnodeIndex), code);
}
- IH_INIT(ih, dp->device, header.id, header.largeVnodeIndex);
+ IH_INIT(ih, dp->device, header.parent, header.largeVnodeIndex);
fdP = IH_OPEN(ih);
if (fdP == NULL) {
perror("opening large vnode index");
#endif
}
#ifdef AFS_NAMEI_ENV
- IH_INIT(ih, dp->device, header.id, header.linkTable);
+ IH_INIT(ih, dp->device, header.parent, header.linkTable);
fdP = IH_OPEN(ih);
if (fdP == NULL) {
perror("opening link table index");
vp = AttachVolume(dp, name, &header);
if (!vp) {
printf("Volinfo: Error attaching volume header %s\n", name);
- exit(1);
+ return;
}
}
PrintHeader(vp);
if (saveinodes)
printf
("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
- printf("%u\t%9d%9d%10d%10d%9d\t%24s\n", V_id(vp), Vdiskused, Vauxsize_k,
- Vvnodesize_k, totvolsize, totvolsize - Vdiskused, V_name(vp));
+ printf("%u\t%9d%9d%10d%10d%9d\t%24s\n", V_id(vp), Vdiskused,
+ Vauxsize_k, Vvnodesize_k, totvolsize, totvolsize - Vdiskused,
+ V_name(vp));
}
+ free(vp->header);
+ free(vp);
}
int
register struct cmd_syndesc *ts;
afs_int32 code;
- ts = cmd_CreateSyntax(NULL, handleit, 0, "Dump volume's internal state");
+ ts = cmd_CreateSyntax(NULL, handleit, NULL, "Dump volume's internal state");
cmd_AddParm(ts, "-online", CMD_FLAG, CMD_OPTIONAL,
"Get info from running fileserver");
cmd_AddParm(ts, "-vnode", CMD_FLAG, CMD_OPTIONAL, "Dump vnode info");
V_dayUse(vp), V_weekUse(vp)[0], V_weekUse(vp)[1], V_weekUse(vp)[2],
V_weekUse(vp)[3], V_weekUse(vp)[4], V_weekUse(vp)[5],
V_weekUse(vp)[6], date(V_dayUseDate(vp)));
+ printf("volUpdateCounter = %u\n", V_volUpCounter(vp));
}
/* GetFileInfo