2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* ilist_nt.c - List the "inode" information for one or all volumes on
14 #include <afs/param.h>
15 #include <afsconfig.h>
24 #include <afs/afsint.h>
28 #include "viceinode.h"
33 printf("Usage: ilist ilist partition [volume]\n");
34 printf("List all \"inodes\" for the volume group containing the volume\n");
35 printf("or for the entire partition.\n");
39 /* This judge function can be a dummy since I know how nt_ListAFSFiles works */
40 int Judge(struct ViceInodeInfo *info, int vid)
45 int PrintInodeInfo(FILE *fp, struct ViceInodeInfo *info, char *dir, char *name)
47 static int lastVID = -1;
51 rwVID = info->u.param[1] == -1 ? info->u.special.parentId :
52 info->u.vnode.volumeId;
54 if (rwVID != lastVID) {
58 /* This munging of the name remove a "\R". */
59 (void) strcpy(dname, dir);
60 dname[strlen(dname)-2] = '\0';
61 printf("Parent Volume %d, Directory %s\n", rwVID, dname);
62 printf("%14s %8s %5s %10s %10s %10s %10s %s\n", "Inode", "Size",
63 "Nlink", "P1", "P2", "P3", "P4", "Name");
65 printf("%14I64d %8d %5d %10d %10d %10d %10d %s\n", info->inodeNumber,
66 info->byteCount, info->linkCount, info->u.param[0],
67 info->u.param[1], info->u.param[2], info->u.param[3], name);
71 main(int ac, char **av)
73 int singleVolumeNumber = 0;
77 if (ac < 2 || ac > 3) Usage();
81 singleVolumeNumber = atoi(av[2]);
83 ninodes = nt_ListAFSFiles(part, PrintInodeInfo, stdout,
84 Judge, singleVolumeNumber);