2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
13 Institution: The Information Technology Center, Carnegie-Mellon University
17 #include <afsconfig.h>
18 #include <afs/param.h>
24 #ifdef HAVE_SYS_FILE_H
32 #include <afs/afsint.h>
34 #include <afs/errors.h>
37 #include <afs/afssyscalls.h>
41 #include "partition.h"
42 #include "viceinode.h"
43 #include <afs/afssyscalls.h>
44 #include <afs/afsutil.h>
46 static const char *progname = "volinfo";
48 int DumpVnodes = 0; /* Dump everything, i.e. summary of all vnodes */
49 int DumpInodeNumber = 0; /* Dump inode numbers with vnodes */
50 int DumpDate = 0; /* Dump vnode date (server modify date) with vnode */
51 int InodeTimes = 0; /* Dump some of the dates associated with inodes */
52 #if defined(AFS_NAMEI_ENV)
53 int PrintFileNames = 0;
58 int fixheader = 0, saveinodes = 0, orphaned = 0;
62 * Volume size running totals
65 afs_uint64 diskused_k; /**< volume size from disk data file, in kilobytes */
66 afs_uint64 auxsize; /**< size of header files, in bytes */
67 afs_uint64 auxsize_k; /**< size of header files, in kilobytes */
68 afs_uint64 vnodesize; /**< size of the large and small vnodes, in bytes */
69 afs_uint64 vnodesize_k; /**< size of the large and small vnodes, in kilobytes */
70 afs_uint64 size_k; /**< size of headers and vnodes, in kilobytes */
73 static struct sizeTotals volumeTotals = { 0, 0, 0, 0, 0, 0 };
74 static struct sizeTotals partitionTotals = { 0, 0, 0, 0, 0, 0 };
75 static struct sizeTotals serverTotals = { 0, 0, 0, 0, 0, 0 };
77 /* Forward Declarations */
78 void PrintHeader(Volume * vp);
79 void HandleAllPart(void);
80 void HandlePart(struct DiskPartition64 *partP);
81 void HandleVolume(struct DiskPartition64 *partP, char *name);
82 struct DiskPartition64 *FindCurrentPartition(void);
83 Volume *AttachVolume(struct DiskPartition64 *dp, char *volname,
84 struct VolumeHeader *header);
85 #if defined(AFS_NAMEI_ENV)
86 void PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
87 Inode ino, Volume * vp);
89 void PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
92 void PrintVnodes(Volume * vp, VnodeClass class);
97 #define MAX_DATE_RESULT 100
98 static char results[8][MAX_DATE_RESULT];
100 struct tm *tm = localtime(&date);
103 (void)strftime(buf, 32, "%Y/%m/%d.%H:%M:%S", tm); /* NT does not have %T */
104 snprintf(results[next = (next + 1) & 7], MAX_DATE_RESULT,
105 "%lu (%s)", (unsigned long)date, buf);
106 return results[next];
110 #include "AFS_component_version_number.c"
113 char name[VMAXPATHLEN];
117 static int PrintingVolumeSizes = 0; /* printing volume size lines */
120 * Print the volume size table heading line, if needed.
125 PrintVolumeSizeHeading(void)
127 if (!PrintingVolumeSizes) {
129 ("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
130 PrintingVolumeSizes = 1;
140 AddSizeTotals(struct sizeTotals *a, struct sizeTotals *b)
142 a->diskused_k += b->diskused_k;
143 a->auxsize += b->auxsize;
144 a->auxsize_k += b->auxsize_k;
145 a->vnodesize += b->vnodesize;
146 a->vnodesize_k += b->vnodesize_k;
147 a->size_k += b->size_k;
151 * Print the sizes for a volume.
156 PrintVolumeSizes(Volume * vp)
158 afs_int64 diff_k = volumeTotals.size_k - volumeTotals.diskused_k;
160 PrintVolumeSizeHeading();
161 printf("%u\t%9llu%9llu%10llu%10llu%9lld\t%24s\n",
163 volumeTotals.diskused_k,
164 volumeTotals.auxsize_k, volumeTotals.vnodesize_k,
165 volumeTotals.size_k, diff_k, V_name(vp));
169 * Print the size totals for the partition.
174 PrintPartitionTotals(afs_uint64 nvols)
176 afs_int64 diff_k = partitionTotals.size_k - partitionTotals.diskused_k;
178 PrintVolumeSizeHeading();
179 printf("\nPart Totals %12llu%9llu%10llu%10llu%9lld (%llu volumes)\n\n",
180 partitionTotals.diskused_k, partitionTotals.auxsize,
181 partitionTotals.vnodesize, partitionTotals.size_k, diff_k, nvols);
182 PrintingVolumeSizes = 0;
186 * Print the size totals for all the partitions.
191 PrintServerTotals(void)
193 afs_int64 diff_k = serverTotals.size_k - serverTotals.diskused_k;
195 printf("\nServer Totals%12lld%9lld%10lld%10lld%9lld\n",
196 serverTotals.diskused_k, serverTotals.auxsize,
197 serverTotals.vnodesize, serverTotals.size_k, diff_k);
201 ReadHdr1(IHandle_t * ih, char *to, int size, u_int magic, u_int version)
203 struct versionStamp *vsn;
207 vsn = (struct versionStamp *)to;
209 code = IH_IREAD(ih, 0, to, size);
213 if (vsn->magic != magic) {
215 fprintf(stderr, "%s: Inode %s: Bad magic %x (%x): IGNORED\n",
216 progname, PrintInode(NULL, ih->ih_ino), vsn->magic, magic);
219 /* Check is conditional, in case caller wants to inspect version himself */
220 if (version && vsn->version != version) {
222 fprintf(stderr, "%s: Inode %s: Bad version %x (%x): IGNORED\n",
224 PrintInode(NULL, ih->ih_ino), vsn->version, version);
226 if (bad && fixheader) {
228 vsn->version = version;
229 printf("Special index inode %s has a bad header. Reconstructing...\n",
230 PrintInode(NULL, ih->ih_ino));
231 code = IH_IWRITE(ih, 0, to, size);
234 "%s: Write failed for inode %s; header left in damaged state\n",
235 progname, PrintInode(NULL, ih->ih_ino));
238 if (!dsizeOnly && !saveinodes) {
239 printf("Inode %s: Good magic %x and version %x\n",
240 PrintInode(NULL, ih->ih_ino), magic, version);
248 AttachVolume(struct DiskPartition64 * dp, char *volname,
249 struct VolumeHeader * header)
254 vp = (Volume *) calloc(1, sizeof(Volume));
255 vp->specialStatus = 0;
256 vp->device = dp->device;
258 IH_INIT(vp->vnodeIndex[vLarge].handle, dp->device, header->parent,
259 header->largeVnodeIndex);
260 IH_INIT(vp->vnodeIndex[vSmall].handle, dp->device, header->parent,
261 header->smallVnodeIndex);
262 IH_INIT(vp->diskDataHandle, dp->device, header->parent,
264 IH_INIT(V_linkHandle(vp), dp->device, header->parent, header->linkTable);
265 vp->cacheCheck = 0; /* XXXX */
266 vp->shuttingDown = 0;
267 vp->goingOffline = 0;
269 vp->header = (struct volHeader *)calloc(1, sizeof(*vp->header));
270 ec = ReadHdr1(V_diskDataHandle(vp), (char *)&V_disk(vp),
271 sizeof(V_disk(vp)), VOLUMEINFOMAGIC, VOLUMEINFOVERSION);
273 struct IndexFileHeader iHead;
274 ec = ReadHdr1(vp->vnodeIndex[vSmall].handle, (char *)&iHead,
275 sizeof(iHead), SMALLINDEXMAGIC, SMALLINDEXVERSION);
278 struct IndexFileHeader iHead;
279 ec = ReadHdr1(vp->vnodeIndex[vLarge].handle, (char *)&iHead,
280 sizeof(iHead), LARGEINDEXMAGIC, LARGEINDEXVERSION);
284 struct versionStamp stamp;
285 ec = ReadHdr1(V_linkHandle(vp), (char *)&stamp, sizeof(stamp),
286 LINKTABLEMAGIC, LINKTABLEVERSION);
296 handleit(struct cmd_syndesc *as, void *arock)
300 afs_uint32 volumeId = 0;
302 struct DiskPartition64 *partP = NULL;
306 if (geteuid() != 0) {
307 fprintf(stderr, "%s: Must be run as root; sorry\n", progname);
312 if (as->parms[0].items)
316 if (as->parms[1].items)
320 if (as->parms[2].items)
324 if (as->parms[3].items)
328 if (as->parms[4].items)
332 if ((ti = as->parms[5].items))
334 if ((ti = as->parms[6].items))
335 volumeId = strtoul(ti->data, NULL, 10);
336 if (as->parms[7].items)
340 if (as->parms[8].items) {
346 if (as->parms[9].items) {
350 if (as->parms[10].items) {
356 if (as->parms[11].items) {
361 #if defined(AFS_NAMEI_ENV)
362 if (as->parms[12].items) {
371 err = VAttachPartitions();
373 fprintf(stderr, "%s: %d partitions had errors during attach.\n",
378 partP = VGetPartition(partName, 0);
380 fprintf(stderr, "%s: %s is not an AFS partition name on this server.\n",
396 partP = FindCurrentPartition();
399 "%s: Current partition is not a vice partition.\n",
404 snprintf(name1, sizeof name1, VFORMAT,
405 afs_printable_uint32_lu(volumeId));
406 HandleVolume(partP, name1);
413 struct DiskPartition64 *
414 FindCurrentPartition(void)
416 int dr = _getdrive();
417 struct DiskPartition64 *dp;
420 for (dp = DiskPartitionList; dp; dp = dp->next) {
421 if (*dp->devName - 'A' == dr)
425 fprintf(stderr, "%s: Current drive is not a valid vice partition.\n",
431 struct DiskPartition64 *
432 FindCurrentPartition(void)
437 struct DiskPartition64 *dp;
439 if (!getcwd(partName, 1023)) {
440 fprintf(stderr, "%s: Failed to get current working directory: ",
445 p = strchr(&partName[1], OS_DIRSEPC);
450 if (!(dp = VGetPartition(partName, 0))) {
453 fprintf(stderr, "%s: %s is not a valid vice partition.\n", progname,
464 struct DiskPartition64 *partP;
467 for (partP = DiskPartitionList; partP; partP = partP->next) {
468 printf("Processing Partition %s:\n", partP->name);
471 AddSizeTotals(&serverTotals, &partitionTotals);
482 HandlePart(struct DiskPartition64 *partP)
490 (void)sprintf(pname, "%s\\", VPartitionPath(partP));
492 char *p = VPartitionPath(partP);
495 if ((dirp = opendir(p)) == NULL) {
496 fprintf(stderr, "%s: Can't read directory %s; giving up\n", progname,
500 while ((dp = readdir(dirp))) {
501 p = (char *)strrchr(dp->d_name, '.');
502 if (p != NULL && strcmp(p, VHDREXT) == 0) {
503 HandleVolume(partP, dp->d_name);
506 AddSizeTotals(&partitionTotals, &volumeTotals);
512 PrintPartitionTotals(nvols);
517 * Inspect a volume header special file.
519 * @param[in] name descriptive name of the type of header special file
520 * @param[in] dp partition object for this volume
521 * @param[in] header header object for this volume
522 * @param[in] inode fileserver inode number for this header special file
523 * @param[out] psize total of the header special file
528 HandleSpecialFile(const char *name, struct DiskPartition64 *dp,
529 struct VolumeHeader *header, Inode inode,
530 afs_sfsize_t * psize)
532 afs_sfsize_t size = 0;
533 IHandle_t *ih = NULL;
534 FdHandle_t *fdP = NULL;
537 #endif /* AFS_NAMEI_ENV */
539 IH_INIT(ih, dp->device, header->parent, inode);
543 "%s: Error opening header file '%s' for volume %u", progname,
548 size = FDH_SIZE(fdP);
551 "%s: Error getting size of header file '%s' for volume %u",
552 progname, name, header->id);
556 if (!dsizeOnly && !saveinodes) {
557 printf("\t%s inode\t= %s (size = %lld)\n",
558 name, PrintInode(NULL, inode), size);
560 namei_HandleToName(&filename, ih);
561 printf("\t%s namei\t= %s\n", name, filename.n_path);
562 #endif /* AFS_NAMEI_ENV */
568 FDH_REALLYCLOSE(fdP);
576 * Inspect this volume header files.
578 * @param[in] dp partition object for this volume
579 * @param[in] header_fd volume header file descriptor
580 * @param[in] header volume header object
581 * @param[out] psize total of the header special file
586 HandleHeaderFiles(struct DiskPartition64 *dp, FD_t header_fd,
587 struct VolumeHeader *header)
589 afs_sfsize_t size = 0;
591 if (!dsizeOnly && !saveinodes) {
592 size = OS_SIZE(header_fd);
593 printf("Volume header (size = %lld):\n", size);
594 printf("\tstamp\t= 0x%x\n", header->stamp.version);
595 printf("\tVolId\t= %u\n", header->id);
596 printf("\tparent\t= %u\n", header->parent);
599 HandleSpecialFile("Info", dp, header, header->volumeInfo, &size);
600 HandleSpecialFile("Small", dp, header, header->smallVnodeIndex,
602 HandleSpecialFile("Large", dp, header, header->largeVnodeIndex,
605 HandleSpecialFile("Link", dp, header, header->linkTable, &size);
606 #endif /* AFS_NAMEI_ENV */
608 if (!dsizeOnly && !saveinodes) {
609 printf("Total aux volume size = %lld\n\n", size);
613 volumeTotals.auxsize = size;
614 volumeTotals.auxsize_k = size / 1024;
619 HandleVolume(struct DiskPartition64 *dp, char *name)
621 struct VolumeHeader header;
622 struct VolumeDiskHeader diskHeader;
623 FD_t fd = INVALID_FD;
625 char headerName[1024];
628 fprintf(stderr, "%s: -online not supported\n", progname);
633 snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
634 VPartitionPath(dp), name);
635 if ((fd = OS_OPEN(headerName, O_RDONLY, 0666)) == INVALID_FD
636 || OS_SIZE(fd) < 0) {
637 fprintf(stderr, "%s: Cannot read volume header %s\n", progname,
642 n = OS_READ(fd, &diskHeader, sizeof(diskHeader));
644 if (n != sizeof(diskHeader)
645 || diskHeader.stamp.magic != VOLUMEHEADERMAGIC) {
646 fprintf(stderr, "%s: Error reading volume header %s\n", progname,
650 if (diskHeader.stamp.version != VOLUMEHEADERVERSION) {
652 "%s: Volume %s, version number is incorrect; volume needs salvage\n",
656 DiskToVolumeHeader(&header, &diskHeader);
659 HandleHeaderFiles(dp, fd, &header);
662 vp = AttachVolume(dp, name, &header);
664 fprintf(stderr, "%s: Error attaching volume header %s\n",
671 if (!dsizeOnly && !saveinodes)
672 printf("\nLarge vnodes (directories)\n");
673 PrintVnodes(vp, vLarge);
674 if (!dsizeOnly && !saveinodes) {
675 printf("\nSmall vnodes(files, symbolic links)\n");
679 printf("Saving all volume files to current directory ...\n");
680 PrintingVolumeSizes = 0; /* -saveinodes interfers with -sizeOnly */
682 PrintVnodes(vp, vSmall);
685 volumeTotals.size_k =
686 volumeTotals.auxsize_k + volumeTotals.vnodesize_k;
687 PrintVolumeSizes(vp);
694 main(int argc, char **argv)
696 struct cmd_syndesc *ts;
699 ts = cmd_CreateSyntax(NULL, handleit, NULL, "Dump volume's internal state");
700 cmd_AddParm(ts, "-online", CMD_FLAG, CMD_OPTIONAL,
701 "Get info from running fileserver");
702 cmd_AddParm(ts, "-vnode", CMD_FLAG, CMD_OPTIONAL, "Dump vnode info");
703 cmd_AddParm(ts, "-date", CMD_FLAG, CMD_OPTIONAL,
704 "Also dump vnode's mod date");
705 cmd_AddParm(ts, "-inode", CMD_FLAG, CMD_OPTIONAL,
706 "Also dump vnode's inode number");
707 cmd_AddParm(ts, "-itime", CMD_FLAG, CMD_OPTIONAL,
708 "Dump special inode's mod times");
709 cmd_AddParm(ts, "-part", CMD_LIST, CMD_OPTIONAL,
710 "AFS partition name (default current partition)");
711 cmd_AddParm(ts, "-volumeid", CMD_LIST, CMD_OPTIONAL, "Volume id");
712 cmd_AddParm(ts, "-header", CMD_FLAG, CMD_OPTIONAL,
713 "Dump volume's header info");
714 cmd_AddParm(ts, "-sizeOnly", CMD_FLAG, CMD_OPTIONAL,
715 "Dump volume's size");
716 cmd_AddParm(ts, "-fixheader", CMD_FLAG, CMD_OPTIONAL,
717 "Try to fix header");
718 cmd_AddParm(ts, "-saveinodes", CMD_FLAG, CMD_OPTIONAL,
719 "Try to save all inodes");
720 cmd_AddParm(ts, "-orphaned", CMD_FLAG, CMD_OPTIONAL,
721 "List all dir/files without a parent");
722 #if defined(AFS_NAMEI_ENV)
723 cmd_AddParm(ts, "-filenames", CMD_FLAG, CMD_OPTIONAL, "Also dump vnode's namei filename");
725 code = cmd_Dispatch(argc, argv);
729 #define typestring(type) (type == RWVOL? "read/write": type == ROVOL? "readonly": type == BACKVOL? "backup": "unknown")
732 PrintHeader(Volume * vp)
734 volumeTotals.diskused_k = V_diskused(vp);
735 if (dsizeOnly || saveinodes)
737 printf("Volume header for volume %u (%s)\n", V_id(vp), V_name(vp));
738 printf("stamp.magic = %x, stamp.version = %u\n", V_stamp(vp).magic,
739 V_stamp(vp).version);
741 ("inUse = %d, inService = %d, blessed = %d, needsSalvaged = %d, dontSalvage = %d\n",
742 V_inUse(vp), V_inService(vp), V_blessed(vp), V_needsSalvaged(vp),
745 ("type = %d (%s), uniquifier = %u, needsCallback = %d, destroyMe = %x\n",
746 V_type(vp), typestring(V_type(vp)), V_uniquifier(vp),
747 V_needsCallback(vp), V_destroyMe(vp));
749 ("id = %u, parentId = %u, cloneId = %u, backupId = %u, restoredFromId = %u\n",
750 V_id(vp), V_parentId(vp), V_cloneId(vp), V_backupId(vp),
751 V_restoredFromId(vp));
753 ("maxquota = %d, minquota = %d, maxfiles = %d, filecount = %d, diskused = %d\n",
754 V_maxquota(vp), V_minquota(vp), V_maxfiles(vp), V_filecount(vp),
756 printf("creationDate = %s, copyDate = %s\n", date(V_creationDate(vp)),
757 date(V_copyDate(vp)));
758 printf("backupDate = %s, expirationDate = %s\n", date(V_backupDate(vp)),
759 date(V_expirationDate(vp)));
760 printf("accessDate = %s, updateDate = %s\n", date(V_accessDate(vp)),
761 date(V_updateDate(vp)));
762 printf("owner = %u, accountNumber = %u\n", V_owner(vp),
763 V_accountNumber(vp));
765 ("dayUse = %u; week = (%u, %u, %u, %u, %u, %u, %u), dayUseDate = %s\n",
766 V_dayUse(vp), V_weekUse(vp)[0], V_weekUse(vp)[1], V_weekUse(vp)[2],
767 V_weekUse(vp)[3], V_weekUse(vp)[4], V_weekUse(vp)[5],
768 V_weekUse(vp)[6], date(V_dayUseDate(vp)));
769 printf("volUpdateCounter = %u\n", V_volUpCounter(vp));
773 * OS independent file info. Die on failure.
777 NT_date(FILETIME * ft)
779 static char result[8][64];
784 if (!FileTimeToLocalFileTime(ft, &lft)
785 || !FileTimeToSystemTime(&lft, &st)) {
786 fprintf(stderr, "%s: Time conversion failed.\n", progname);
789 sprintf(result[next = ((next + 1) & 7)], "%4d/%02d/%02d.%2d:%2d:%2d",
790 st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
796 GetFileInfo(FD_t fd, int *size, char **ctime, char **mtime, char **atime)
799 BY_HANDLE_FILE_INFORMATION fi;
800 if (!GetFileInformationByHandle(fd, &fi)) {
801 fprintf(stderr, "%s: GetFileInformationByHandle failed, exiting\n",
805 *size = (int)fi.nFileSizeLow;
807 *mtime = NT_date(&fi.ftLastWriteTime);
808 *atime = NT_date(&fi.ftLastAccessTime);
810 struct afs_stat_st status;
811 if (afs_fstat(fd, &status) == -1) {
812 fprintf(stderr, "%s: fstat failed %d\n", progname, errno);
815 *size = (int)status.st_size;
816 *ctime = date(status.st_ctime);
817 *mtime = date(status.st_mtime);
818 *atime = date(status.st_atime);
823 PrintVnodes(Volume * vp, VnodeClass class)
826 (class == vSmall ? SIZEOF_SMALLDISKVNODE : SIZEOF_LARGEDISKVNODE);
827 char buf[SIZEOF_LARGEDISKVNODE];
828 struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
829 StreamHandle_t *file;
830 int vnodeIndex, nVnodes;
831 afs_foff_t offset = 0;
833 IHandle_t *ih = vp->vnodeIndex[class].handle;
836 char *ctime, *atime, *mtime;
837 char nfile[50], buffer[256];
844 fprintf(stderr, "%s: open failed: ", progname);
848 file = FDH_FDOPEN(fdP, "r");
850 fprintf(stderr, "%s: fdopen failed\n", progname);
854 GetFileInfo(fdP->fd_fd, &size, &ctime, &atime, &mtime);
855 if (InodeTimes && !dsizeOnly) {
856 printf("ichanged : %s\nimodified: %s\niaccessed: %s\n\n", ctime,
860 nVnodes = (size / diskSize) - 1;
862 STREAM_ASEEK(file, diskSize);
867 nVnodes && STREAM_READ(vnode, diskSize, 1, file) == 1;
868 nVnodes--, vnodeIndex++, offset += diskSize) {
870 ino = VNDISK_GET_INO(vnode);
872 if (!VALID_INO(ino)) {
875 if (dsizeOnly && (class == vLarge)) {
876 afs_fsize_t fileLength;
878 VNDISK_GET_LEN(fileLength, vnode);
879 if (fileLength > 0) {
880 volumeTotals.vnodesize += fileLength;
881 volumeTotals.vnodesize_k += fileLength / 1024;
883 } else if (class == vSmall) {
886 IH_INIT(ih1, V_device(vp), V_parentId(vp), ino);
890 "%s: Can't open inode %s error %d (ignored)\n",
891 progname, PrintInode(NULL, ino), errno);
894 snprintf(nfile, sizeof nfile, "TmpInode.%s",
895 PrintInode(NULL, ino));
896 ofd = afs_open(nfile, O_CREAT | O_RDWR | O_TRUNC, 0600);
899 "%s: Can't create file %s; error %d (ignored)\n",
900 progname, nfile, errno);
906 len = FDH_PREAD(fdP1, buffer, sizeof(buffer), total);
908 FDH_REALLYCLOSE(fdP1);
913 "%s: Error while reading from inode %s (%d - ignored)\n",
914 progname, PrintInode(NULL, ino), errno);
919 break; /* No more input */
920 nBytes = write(ofd, buffer, len);
922 FDH_REALLYCLOSE(fdP1);
927 "%s: Error while writing to \"%s\" (%d - ignored)\n",
928 progname, nfile, errno);
936 FDH_REALLYCLOSE(fdP1);
939 printf("... Copied inode %s to file %s (%lu bytes)\n",
940 PrintInode(NULL, ino), nfile, (unsigned long)total);
943 #if defined(AFS_NAMEI_ENV)
944 PrintVnode(offset, vnode,
945 bitNumberToVnodeNumber(vnodeIndex, class), ino, vp);
947 PrintVnode(offset, vnode,
948 bitNumberToVnodeNumber(vnodeIndex, class), ino);
956 #if defined(AFS_NAMEI_ENV)
958 PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
959 Inode ino, Volume * vp)
962 PrintVnode(afs_foff_t offset, VnodeDiskObject * vnode, VnodeId vnodeNumber,
966 #if defined(AFS_NAMEI_ENV)
970 afs_fsize_t fileLength;
972 VNDISK_GET_LEN(fileLength, vnode);
973 if (fileLength > 0) {
974 volumeTotals.vnodesize += fileLength;
975 volumeTotals.vnodesize_k += fileLength / 1024;
979 if (orphaned && (fileLength == 0 || vnode->parent || !offset))
982 ("%10lld Vnode %u.%u.%u cloned: %u, length: %llu linkCount: %d parent: %u",
983 (long long)offset, vnodeNumber, vnode->uniquifier, vnode->dataVersion,
984 vnode->cloned, (afs_uintmax_t) fileLength, vnode->linkCount,
987 printf(" inode: %s", PrintInode(NULL, ino));
989 printf(" ServerModTime: %s", date(vnode->serverModifyTime));
990 #if defined(AFS_NAMEI_ENV)
991 if (PrintFileNames) {
992 IH_INIT(ihtmpp, V_device(vp), V_parentId(vp), ino);
993 namei_HandleToName(&filename, ihtmpp);
994 #if !defined(AFS_NT40_ENV)
995 printf(" UFS-Filename: %s", filename.n_path);
997 printf(" NTFS-Filename: %s", filename.n_path);