#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <ctype.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#include <time.h>
-#include <io.h>
-#else
-#include <sys/param.h>
+
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#include <sys/time.h>
#endif
+
#include <afs/cmd.h>
#include <afs/dir.h>
#include <afs/afssyscalls.h>
#include <afs/afsutil.h>
-#ifdef _AIX
-#include <time.h>
-#endif
-
-#include <dirent.h>
-
-#ifdef O_LARGEFILE
-#define afs_stat stat64
-#define afs_fstat fstat64
-#define afs_open open64
-#else /* !O_LARGEFILE */
-#define afs_stat stat
-#define afs_fstat fstat
-#define afs_open open
-#endif /* !O_LARGEFILE */
+static const char *progname = "volinfo";
int DumpVnodes = 0; /* Dump everything, i.e. summary of all vnodes */
int DumpInodeNumber = 0; /* Dump inode numbers with vnodes */
Volume *AttachVolume(struct DiskPartition64 *dp, char *volname,
struct VolumeHeader *header);
#if defined(AFS_NAMEI_ENV)
-void PrintVnode(int offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
+void PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
Inode ino, Volume * vp);
#else
-void PrintVnode(int offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
+void PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
Inode ino);
#endif
void PrintVnodes(Volume * vp, VnodeClass class);
char buf[32];
(void)strftime(buf, 32, "%Y/%m/%d.%H:%M:%S", tm); /* NT does not have %T */
- (void)afs_snprintf(results[next = (next + 1) & 7], MAX_DATE_RESULT,
- "%lu (%s)", (unsigned long)date, buf);
+ snprintf(results[next = (next + 1) & 7], MAX_DATE_RESULT,
+ "%lu (%s)", (unsigned long)date, buf);
return results[next];
}
char BU[1000];
+static int PrintingVolumeSizes = 0; /* printing volume size lines */
+
+/**
+ * Print the volume size table heading line, if needed.
+ *
+ * @return none
+ */
+static void
+PrintVolumeSizeHeading(void)
+{
+ if (!PrintingVolumeSizes) {
+ printf
+ ("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
+ PrintingVolumeSizes = 1;
+ }
+}
+
+/**
+ * Print the sizes for a volume.
+ *
+ * @return none
+ */
+static void
+PrintVolumeSizes(Volume * vp)
+{
+ PrintVolumeSizeHeading();
+ 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));
+}
+
+/**
+ * Print the size totals for the partition.
+ *
+ * @return none
+ */
+static void
+PrintPartitionTotals(int nvols)
+{
+ PrintVolumeSizeHeading();
+ printf("\nPart Totals %12d%9d%10d%10d%9d (%d volumes)\n\n",
+ TVdiskused, TVauxsize, TVvnodesize, Totvolsize,
+ Totvolsize - TVdiskused, nvols);
+ PrintingVolumeSizes = 0;
+}
+
+/**
+ * Print the size totals for all the partitions.
+ *
+ * @return none
+ */
+static void
+PrintServerTotals(void)
+{
+ printf("\nServer Totals%12d%9d%10d%10d%9d\n", SVdiskused, SVauxsize,
+ SVvnodesize, Stotvolsize, Stotvolsize - SVdiskused);
+}
+
int
ReadHdr1(IHandle_t * ih, char *to, int size, u_int magic, u_int version)
{
if (vsn->magic != magic) {
bad++;
- printf("Inode %s: Bad magic %x (%x): IGNORED\n",
- PrintInode(NULL, ih->ih_ino), vsn->magic, magic);
+ fprintf(stderr, "%s: Inode %s: Bad magic %x (%x): IGNORED\n",
+ progname, PrintInode(NULL, ih->ih_ino), vsn->magic, magic);
}
/* Check is conditional, in case caller wants to inspect version himself */
if (version && vsn->version != version) {
bad++;
- printf("Inode %s: Bad version %x (%x): IGNORED\n",
- PrintInode(NULL, ih->ih_ino), vsn->version, version);
+ fprintf(stderr, "%s: Inode %s: Bad version %x (%x): IGNORED\n",
+ progname,
+ PrintInode(NULL, ih->ih_ino), vsn->version, version);
}
if (bad && fixheader) {
vsn->magic = magic;
PrintInode(NULL, ih->ih_ino));
code = IH_IWRITE(ih, 0, to, size);
if (code != size) {
- printf("Write failed; header left in damaged state\n");
+ fprintf(stderr,
+ "%s: Write failed for inode %s; header left in damaged state\n",
+ progname, PrintInode(NULL, ih->ih_ino));
}
} else {
if (!dsizeOnly && !saveinodes) {
#ifndef AFS_NT40_ENV
if (geteuid() != 0) {
- printf("vol-info must be run as root; sorry\n");
+ fprintf(stderr, "%s: Must be run as root; sorry\n", progname);
exit(1);
}
#endif
orphaned = 1;
DumpVnodes = 1;
} else
+ orphaned = 0;
#if defined(AFS_NAMEI_ENV)
if (as->parms[12].items) {
PrintFileNames = 1;
DumpVnodes = 1;
} else
+ PrintFileNames = 0;
#endif
- orphaned = 0;
DInit(10);
err = VAttachPartitions();
if (err) {
- printf("%d partitions had errors during attach.\n", err);
+ fprintf(stderr, "%s: %d partitions had errors during attach.\n",
+ progname, err);
}
if (partName) {
partP = VGetPartition(partName, 0);
if (!partP) {
- printf("%s is not an AFS partition name on this server.\n",
- partName);
+ fprintf(stderr, "%s: %s is not an AFS partition name on this server.\n",
+ progname, partName);
exit(1);
}
}
if (!partP) {
partP = FindCurrentPartition();
if (!partP) {
- printf("Current partition is not a vice partition.\n");
+ fprintf(stderr,
+ "%s: Current partition is not a vice partition.\n",
+ progname);
exit(1);
}
}
- (void)afs_snprintf(name1, sizeof name1, VFORMAT,
- afs_printable_uint32_lu(volumeId));
- if (dsizeOnly && !saveinodes)
- printf
- ("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
+ snprintf(name1, sizeof name1, VFORMAT,
+ afs_printable_uint32_lu(volumeId));
HandleVolume(partP, name1);
}
return 0;
break;
}
if (!dp) {
- printf("Current drive is not a valid vice partition.\n");
+ fprintf(stderr, "%s: Current drive is not a valid vice partition.\n",
+ progname);
}
return dp;
}
struct DiskPartition64 *dp;
if (!getcwd(partName, 1023)) {
+ fprintf(stderr, "%s: Failed to get current working directory: ",
+ progname);
perror("pwd");
exit(1);
}
- p = strchr(&partName[1], '/');
+ p = strchr(&partName[1], OS_DIRSEPC);
if (p) {
tmp = *p;
*p = '\0';
if (!(dp = VGetPartition(partName, 0))) {
if (tmp)
*p = tmp;
- printf("%s is not a valid vice partition.\n", partName);
+ fprintf(stderr, "%s: %s is not a valid vice partition.\n", progname,
+ partName);
exit(1);
}
return dp;
}
if (dsizeOnly) {
- printf("\nServer Totals%12d%9d%10d%10d%9d\n", SVdiskused, SVauxsize,
- SVvnodesize, Stotvolsize, Stotvolsize - SVdiskused);
+ PrintServerTotals();
}
}
#endif
if ((dirp = opendir(p)) == NULL) {
- printf("Can't read directory %s; giving up\n", p);
+ fprintf(stderr, "%s: Can't read directory %s; giving up\n", progname,
+ p);
exit(1);
}
- if (dsizeOnly && !saveinodes)
- printf
- ("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
while ((dp = readdir(dirp))) {
p = (char *)strrchr(dp->d_name, '.');
if (p != NULL && strcmp(p, VHDREXT) == 0) {
}
closedir(dirp);
if (dsizeOnly) {
- printf("\nPart Totals %12d%9d%10d%10d%9d (%d volumes)\n\n",
- TVdiskused, TVauxsize, TVvnodesize, Totvolsize,
- Totvolsize - TVdiskused, nvols);
+ PrintPartitionTotals(nvols);
}
}
+/**
+ * Inspect a volume header special file.
+ *
+ * @param[in] name descriptive name of the type of header special file
+ * @param[in] dp partition object for this volume
+ * @param[in] header header object for this volume
+ * @param[in] inode fileserver inode number for this header special file
+ * @param[out] psize total of the header special file
+ *
+ * @return none
+ */
+void
+HandleSpecialFile(const char *name, struct DiskPartition64 *dp,
+ struct VolumeHeader *header, Inode inode,
+ afs_sfsize_t * psize)
+{
+ afs_sfsize_t size = 0;
+ IHandle_t *ih = NULL;
+ FdHandle_t *fdP = NULL;
+#ifdef AFS_NAMEI_ENV
+ namei_t filename;
+#endif /* AFS_NAMEI_ENV */
+
+ IH_INIT(ih, dp->device, header->parent, inode);
+ fdP = IH_OPEN(ih);
+ if (fdP == NULL) {
+ fprintf(stderr,
+ "%s: Error opening header file '%s' for volume %u", progname,
+ name, 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",
+ progname, name, header->id);
+ perror("fstat");
+ goto error;
+ }
+ if (!dsizeOnly && !saveinodes) {
+ printf("\t%s inode\t= %s (size = %lld)\n",
+ name, PrintInode(NULL, inode), size);
+#ifdef AFS_NAMEI_ENV
+ namei_HandleToName(&filename, ih);
+ printf("\t%s namei\t= %s\n", name, filename.n_path);
+#endif /* AFS_NAMEI_ENV */
+ }
+ *psize += size;
+
+ error:
+ if (fdP != NULL) {
+ FDH_REALLYCLOSE(fdP);
+ }
+ if (ih != NULL) {
+ IH_RELEASE(ih);
+ }
+}
+
+/**
+ * Inspect this volume header files.
+ *
+ * @param[in] dp partition object for this volume
+ * @param[in] header_fd volume header file descriptor
+ * @param[in] header volume header object
+ * @param[out] psize total of the header special file
+ *
+ * @return none
+ */
+void
+HandleHeaderFiles(struct DiskPartition64 *dp, FD_t header_fd,
+ struct VolumeHeader *header)
+{
+ afs_sfsize_t size = 0;
+
+ if (!dsizeOnly && !saveinodes) {
+ 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);
+ }
+
+ HandleSpecialFile("Info", dp, header, header->volumeInfo, &size);
+ HandleSpecialFile("Small", dp, header, header->smallVnodeIndex,
+ &size);
+ HandleSpecialFile("Large", dp, header, header->largeVnodeIndex,
+ &size);
+#ifdef AFS_NAMEI_ENV
+ HandleSpecialFile("Link", dp, header, header->linkTable, &size);
+#endif /* AFS_NAMEI_ENV */
+
+ if (!dsizeOnly && !saveinodes) {
+ printf("Total aux volume size = %lld\n\n", size);
+ }
+ Vauxsize = size;
+ Vauxsize_k = size / 1024;
+}
void
HandleVolume(struct DiskPartition64 *dp, char *name)
{
struct VolumeHeader header;
struct VolumeDiskHeader diskHeader;
- struct afs_stat status, stat;
- int fd;
+ FD_t fd = INVALID_FD;
Volume *vp;
- IHandle_t *ih;
char headerName[1024];
if (online) {
- printf("volinfo: -online not supported\n");
+ fprintf(stderr, "%s: -online not supported\n", progname);
exit(1);
} else {
- afs_int32 n;
-
- (void)afs_snprintf(headerName, sizeof headerName, "%s/%s",
- VPartitionPath(dp), name);
- if ((fd = afs_open(headerName, O_RDONLY)) == -1
- || afs_fstat(fd, &status) == -1) {
- printf("Volinfo: Cannot read volume header %s\n", name);
- close(fd);
+ afs_sfsize_t n;
+
+ snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
+ VPartitionPath(dp), name);
+ if ((fd = OS_OPEN(headerName, O_RDONLY, 0666)) == INVALID_FD
+ || OS_SIZE(fd) < 0) {
+ fprintf(stderr, "%s: Cannot read volume header %s\n", progname,
+ name);
+ OS_CLOSE(fd);
exit(1);
}
- n = read(fd, &diskHeader, sizeof(diskHeader));
+ n = OS_READ(fd, &diskHeader, sizeof(diskHeader));
if (n != sizeof(diskHeader)
|| diskHeader.stamp.magic != VOLUMEHEADERMAGIC) {
- printf("Volinfo: Error reading volume header %s\n", name);
+ fprintf(stderr, "%s: Error reading volume header %s\n", progname,
+ name);
exit(1);
}
if (diskHeader.stamp.version != VOLUMEHEADERVERSION) {
- printf
- ("Volinfo: Volume %s, version number is incorrect; volume needs salvage\n",
- name);
+ fprintf(stderr,
+ "%s: Volume %s, version number is incorrect; volume needs salvage\n",
+ progname, name);
exit(1);
}
DiskToVolumeHeader(&header, &diskHeader);
if (dheader) {
- FdHandle_t *fdP;
- afs_sfsize_t size = 0;
- afs_sfsize_t code;
-
- if (afs_fstat(fd, &stat) == -1) {
- perror("stat");
- exit(1);
- }
- if (!dsizeOnly && !saveinodes) {
- size = stat.st_size;
- printf("Volume header (size = %d):\n", (int)size);
- printf("\tstamp\t= 0x%x\n", header.stamp.version);
- printf("\tVolId\t= %u\n", header.id);
- }
-
- IH_INIT(ih, dp->device, header.parent, header.volumeInfo);
- fdP = IH_OPEN(ih);
- if (fdP == NULL) {
- perror("opening volume info");
- exit(1);
- }
- code = FDH_SIZE(fdP);
- if (code == -1) {
- perror("fstat");
- exit(1);
- }
- FDH_REALLYCLOSE(fdP);
- IH_RELEASE(ih);
- size += code;
- if (!dsizeOnly && !saveinodes) {
- printf("\tparent\t= %u\n", header.parent);
- printf("\tInfo inode\t= %s (size = %d)\n",
- PrintInode(NULL, header.volumeInfo), (int)code);
- }
-
- IH_INIT(ih, dp->device, header.parent, header.smallVnodeIndex);
- fdP = IH_OPEN(ih);
- if (fdP == NULL) {
- perror("opening small vnode index");
- exit(1);
- }
- code = FDH_SIZE(fdP);
- if (code == -1) {
- perror("fstat");
- exit(1);
- }
- FDH_REALLYCLOSE(fdP);
- IH_RELEASE(ih);
- size += code;
- if (!dsizeOnly && !saveinodes) {
- printf("\tSmall inode\t= %s (size = %d)\n",
- PrintInode(NULL, header.smallVnodeIndex), (int)code);
- }
-
- IH_INIT(ih, dp->device, header.parent, header.largeVnodeIndex);
- fdP = IH_OPEN(ih);
- if (fdP == NULL) {
- perror("opening large vnode index");
- exit(1);
- }
- code = FDH_SIZE(fdP);
- if (code == -1) {
- perror("fstat");
- exit(1);
- }
- FDH_REALLYCLOSE(fdP);
- IH_RELEASE(ih);
- size += code;
- if (!dsizeOnly && !saveinodes) {
- printf("\tLarge inode\t= %s (size = %d)\n",
- PrintInode(NULL, header.largeVnodeIndex), (int)code);
-#ifndef AFS_NT40_ENV
- printf("Total aux volume size = %d\n\n", (int)size);
-#endif
- }
-#ifdef AFS_NAMEI_ENV
- IH_INIT(ih, dp->device, header.parent, header.linkTable);
- fdP = IH_OPEN(ih);
- if (fdP == NULL) {
- perror("opening link table index");
- exit(1);
- }
- code = FDH_SIZE(fdP);
- if (code == -1) {
- perror("fstat");
- exit(1);
- }
- FDH_REALLYCLOSE(fdP);
- IH_RELEASE(ih);
- size += code;
- if (!dsizeOnly && !saveinodes) {
- printf("\tLink inode\t= %s (size = %d)\n",
- PrintInode(NULL, header.linkTable), (int)code);
- printf("Total aux volume size = %d\n\n", (int)size);
- }
-#endif
- Vauxsize = size;
- Vauxsize_k = size / 1024;
+ HandleHeaderFiles(dp, fd, &header);
}
- close(fd);
+ OS_CLOSE(fd);
vp = AttachVolume(dp, name, &header);
if (!vp) {
- printf("Volinfo: Error attaching volume header %s\n", name);
+ fprintf(stderr, "%s: Error attaching volume header %s\n",
+ progname, name);
return;
}
}
printf("\nSmall vnodes(files, symbolic links)\n");
fflush(stdout);
}
- if (saveinodes)
+ if (saveinodes) {
printf("Saving all volume files to current directory ...\n");
+ PrintingVolumeSizes = 0; /* -saveinodes interfers with -sizeOnly */
+ }
PrintVnodes(vp, vSmall);
}
if (dsizeOnly) {
totvolsize = Vauxsize_k + Vvnodesize_k;
- 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));
+ PrintVolumeSizes(vp);
}
free(vp->header);
free(vp);
cmd_AddParm(ts, "-date", CMD_FLAG, CMD_OPTIONAL,
"Also dump vnode's mod date");
cmd_AddParm(ts, "-inode", CMD_FLAG, CMD_OPTIONAL,
- "Dump vnode's inode number");
+ "Also dump vnode's inode number");
cmd_AddParm(ts, "-itime", CMD_FLAG, CMD_OPTIONAL,
"Dump special inode's mod times");
cmd_AddParm(ts, "-part", CMD_LIST, CMD_OPTIONAL,
cmd_AddParm(ts, "-orphaned", CMD_FLAG, CMD_OPTIONAL,
"List all dir/files without a parent");
#if defined(AFS_NAMEI_ENV)
- cmd_AddParm(ts, "-filenames", CMD_FLAG, CMD_OPTIONAL, "Print filenames");
+ cmd_AddParm(ts, "-filenames", CMD_FLAG, CMD_OPTIONAL, "Also dump vnode's namei filename");
#endif
code = cmd_Dispatch(argc, argv);
return code;
if (!FileTimeToLocalFileTime(ft, &lft)
|| !FileTimeToSystemTime(&lft, &st)) {
- printf("Time conversion failed.\n");
+ fprintf(stderr, "%s: Time conversion failed.\n", progname);
exit(1);
}
sprintf(result[next = ((next + 1) & 7)], "%4d/%02d/%02d.%2d:%2d:%2d",
#ifdef AFS_NT40_ENV
BY_HANDLE_FILE_INFORMATION fi;
if (!GetFileInformationByHandle(fd, &fi)) {
- printf("GetFileInformationByHandle failed, exiting\n");
+ fprintf(stderr, "%s: GetFileInformationByHandle failed, exiting\n",
+ progname);
exit(1);
}
*size = (int)fi.nFileSizeLow;
*mtime = NT_date(&fi.ftLastWriteTime);
*atime = NT_date(&fi.ftLastAccessTime);
#else
- struct afs_stat status;
+ struct afs_stat_st status;
if (afs_fstat(fd, &status) == -1) {
- printf("fstat failed %d\n", errno);
+ fprintf(stderr, "%s: fstat failed %d\n", progname, errno);
exit(1);
}
*size = (int)status.st_size;
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
StreamHandle_t *file;
- int vnodeIndex, nVnodes, offset = 0;
+ int vnodeIndex, nVnodes;
+ afs_foff_t offset = 0;
Inode ino;
IHandle_t *ih = vp->vnodeIndex[class].handle;
FdHandle_t *fdP;
fdP = IH_OPEN(ih);
if (fdP == NULL) {
- printf("open failed\n");
+ fprintf(stderr, "%s: open failed: ", progname);
exit(1);
}
file = FDH_FDOPEN(fdP, "r");
if (!file) {
- printf("fdopen failed\n");
+ fprintf(stderr, "%s: fdopen failed\n", progname);
exit(1);
}
ino = VNDISK_GET_INO(vnode);
if (saveinodes) {
- if (VALID_INO(ino) && (class == vSmall)) {
+ if (!VALID_INO(ino)) {
+ continue;
+ }
+ if (dsizeOnly && (class == vLarge)) {
+ afs_fsize_t fileLength;
+
+ VNDISK_GET_LEN(fileLength, vnode);
+ Vvnodesize += fileLength;
+ Vvnodesize_k += fileLength / 1024;
+ } else if (class == vSmall) {
IHandle_t *ih1;
FdHandle_t *fdP1;
IH_INIT(ih1, V_device(vp), V_parentId(vp), ino);
fdP1 = IH_OPEN(ih1);
if (fdP1 == NULL) {
- printf("Can't open inode %s error %d (ignored)\n",
- PrintInode(NULL, ino), errno);
+ fprintf(stderr,
+ "%s: Can't open inode %s error %d (ignored)\n",
+ progname, PrintInode(NULL, ino), errno);
continue;
}
- (void)afs_snprintf(nfile, sizeof nfile, "TmpInode.%s",
- PrintInode(NULL, ino));
+ snprintf(nfile, sizeof nfile, "TmpInode.%s",
+ PrintInode(NULL, ino));
ofd = afs_open(nfile, O_CREAT | O_RDWR | O_TRUNC, 0600);
if (ofd < 0) {
- printf("Can't create file %s; error %d (ignored)\n",
- nfile, errno);
+ fprintf(stderr,
+ "%s: Can't create file %s; error %d (ignored)\n",
+ progname, nfile, errno);
continue;
}
total = bad = 0;
IH_RELEASE(ih1);
close(ofd);
unlink(nfile);
- printf
- ("Error while reading from inode %s (%d - ignored)\n",
- PrintInode(NULL, ino), errno);
+ fprintf(stderr,
+ "%s: Error while reading from inode %s (%d - ignored)\n",
+ progname, PrintInode(NULL, ino), errno);
bad = 1;
break;
}
IH_RELEASE(ih1);
close(ofd);
unlink(nfile);
- printf
- ("Error while writing to \"%s\" (%d - ignored)\n",
- nfile, errno);
+ fprintf(stderr,
+ "%s: Error while writing to \"%s\" (%d - ignored)\n",
+ progname, nfile, errno);
bad = 1;
break;
}
#if defined(AFS_NAMEI_ENV)
void
-PrintVnode(int offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
+PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
Inode ino, Volume * vp)
#else
void
-PrintVnode(int offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
+PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
Inode ino)
#endif
{
#if defined(AFS_NAMEI_ENV)
IHandle_t *ihtmpp;
-#if !defined(AFS_NT40_ENV)
namei_t filename;
-#else
- char filename[MAX_PATH];
-#endif
#endif
afs_fsize_t fileLength;
if (orphaned && (fileLength == 0 || vnode->parent || !offset))
return;
printf
- ("%10d Vnode %u.%u.%u cloned: %u, length: %llu linkCount: %d parent: %u",
- offset, vnodeNumber, vnode->uniquifier, vnode->dataVersion,
+ ("%10lld Vnode %u.%u.%u cloned: %u, length: %llu linkCount: %d parent: %u",
+ (long long)offset, vnodeNumber, vnode->uniquifier, vnode->dataVersion,
vnode->cloned, (afs_uintmax_t) fileLength, vnode->linkCount,
vnode->parent);
if (DumpInodeNumber)
#if defined(AFS_NAMEI_ENV)
if (PrintFileNames) {
IH_INIT(ihtmpp, V_device(vp), V_parentId(vp), ino);
-#if !defined(AFS_NT40_ENV)
namei_HandleToName(&filename, ihtmpp);
+#if !defined(AFS_NT40_ENV)
printf(" UFS-Filename: %s", filename.n_path);
#else
- nt_HandleToName(filename, ihtmpp);
- printf(" NTFS-Filename: %s", filename);
+ printf(" NTFS-Filename: %s", filename.n_path);
#endif
}
#endif