Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / vol / vol-info.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
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
8 */
9
10 #ifndef AFS_VOL_INFO_H
11 #define AFS_VOL_INFO_H
12
13 #include <afs/afsint.h>
14
15 /* scanVolType flags */
16 #define SCAN_RW 0x01 /**< scan read-write volumes vnodes */
17 #define SCAN_RO 0x02 /**< scan read-only volume vnodes */
18 #define SCAN_BK 0x04 /**< scan backup volume vnodes */
19
20 /* findVnType flags */
21 #define FIND_FILE 0x01 /**< find regular files */
22 #define FIND_DIR 0x02 /**< find directories */
23 #define FIND_MOUNT 0x04 /**< find afs mount points */
24 #define FIND_SYMLINK 0x08 /**< find symlinks */
25 #define FIND_ACL 0x10 /**< find access entiries */
26
27
28 struct VolInfoOpt {
29 int checkout; /**< Use FSSYNC to checkout volumes from the fileserver. */
30 int dumpInfo; /**< Dump volume information */
31 int dumpHeader; /**< Dump volume header files info */
32 int dumpVnodes; /**< Dump vnode info */
33 int dumpInodeNumber; /**< Dump inode numbers with vnodes */
34 int dumpDate; /**< Dump vnode date (server modify date) with vnode */
35 int dumpInodeTimes; /**< Dump some of the dates associated with inodes */
36 int dumpFileNames; /**< Dump vnode and special file name filenames */
37 int showOrphaned; /**< Show "orphaned" vnodes (vnodes with parent of 0) */
38 int showSizes; /**< Show volume size summary */
39 int saveInodes; /**< Save vnode data to files */
40 int fixHeader; /**< Repair header files magic and version fields. */
41 char hostname[64]; /**< This hostname, for volscan output. */
42 char columnDelim[16]; /**< Column delimiter char(s) */
43 char printHeading; /**< Print column heading */
44 int checkMagic; /**< Check directory vnode magic when looking up paths */
45 unsigned int modeMask[64]; /**< unix mode bit pattern for searching for specific modes */
46 int scanVolType; /**< volume types to scan; zero means do not check */
47 int findVnType; /**< types of objects to find */
48 };
49
50
51 /*
52 * volscan output columns
53 */
54 #define VOLSCAN_COLUMNS \
55 c(host) \
56 c(desc) \
57 c(vid) \
58 c(offset) \
59 c(vtype) \
60 c(vname) \
61 c(part) \
62 c(partid) \
63 c(fid) \
64 c(path) \
65 c(target) \
66 c(mount) \
67 c(mtype) \
68 c(mcell) \
69 c(mvol) \
70 c(aid) \
71 c(arights) \
72 c(vntype) \
73 c(cloned) \
74 c(mode) \
75 c(links) \
76 c(length) \
77 c(uniq) \
78 c(dv) \
79 c(inode) \
80 c(namei) \
81 c(modtime) \
82 c(author) \
83 c(owner) \
84 c(parent) \
85 c(magic) \
86 c(lock) \
87 c(smodtime) \
88 c(group)
89
90
91 struct VnodeDetails;
92 int volinfo_Init(const char *name);
93 int volinfo_Options(struct VolInfoOpt **optp);
94 void volinfo_AddVnodeToSizeTotals(struct VolInfoOpt *opt, struct VnodeDetails *vdp);
95 void volinfo_SaveInode(struct VolInfoOpt *opt, struct VnodeDetails *vdp);
96 void volinfo_PrintVnode(struct VolInfoOpt *opt, struct VnodeDetails *vdp);
97 void volinfo_PrintVnodeDetails(struct VolInfoOpt *opt, struct VnodeDetails *vdp);
98 void volinfo_ScanAcl(struct VolInfoOpt *opt, struct VnodeDetails *vdp);
99 void volinfo_AddVnodeHandler(int vnodeClass,
100 void (*proc) (struct VolInfoOpt * opt,
101 struct VnodeDetails * vdp),
102 const char *heading);
103 int volinfo_AddOutputColumn(char *name);
104 int volinfo_ScanPartitions(struct VolInfoOpt *opt, char *partNameOrId, VolumeId volumeId);
105
106 #endif /* AFS_VOL_INFO_H */