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 <afsconfig.h>
15 #include <afs/param.h>
23 #include <afs/afsint.h>
27 #include "viceinode.h"
33 printf("Usage: ilist ilist partition [volume]\n");
35 ("List all \"inodes\" for the volume group containing the volume\n");
36 printf("or for the entire partition.\n");
40 /* This judge function can be a dummy since I know how nt_ListAFSFiles works */
42 Judge(struct ViceInodeInfo
*info
, int vid
)
48 PrintInodeInfo(FILE * fp
, struct ViceInodeInfo
*info
, char *dir
, char *name
)
50 static int lastVID
= -1;
56 -1 ? info
->u
.special
.parentId
: info
->u
.vnode
.volumeId
;
58 if (rwVID
!= lastVID
) {
62 /* This munging of the name remove a "\R". */
63 (void)strcpy(dname
, dir
);
64 dname
[strlen(dname
) - 2] = '\0';
65 printf("Parent Volume %d, Directory %s\n", rwVID
, dname
);
66 printf("%14s %8s %5s %10s %10s %10s %10s %s\n", "Inode", "Size",
67 "Nlink", "P1", "P2", "P3", "P4", "Name");
69 printf("%14I64d %8d %5d %10d %10d %10d %10d %s\n", info
->inodeNumber
,
70 info
->byteCount
, info
->linkCount
, info
->u
.param
[0],
71 info
->u
.param
[1], info
->u
.param
[2], info
->u
.param
[3], name
);
75 main(int ac
, char **av
)
77 int singleVolumeNumber
= 0;
86 singleVolumeNumber
= atoi(av
[2]);
89 nt_ListAFSFiles(part
, PrintInodeInfo
, stdout
, Judge
,