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 #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
15 Institution: The Information Technology Center, Carnegie-Mellon University
19 #include <afs/param.h>
21 #if defined(AFS_HPUX_ENV)
22 #define AFS_DSKDEV "/dev/dsk"
23 #define AFS_RDSKDEV "/dev/rdsk/"
24 #define AFS_LVOLDEV "/dev/vg0"
25 #define AFS_ACVOLDEV "/dev/ac"
26 #define AFS_RACVOLDEV "/dev/ac/r"
28 #define AFS_DSKDEV "/dev"
29 #define AFS_RDSKDEV "/dev/r"
32 /* All Vice partitions on a server will have the following name prefix */
33 #define VICE_PARTITION_PREFIX "/vicep"
34 #define VICE_PREFIX_SIZE (sizeof(VICE_PARTITION_PREFIX)-1)
36 /* For NT, the roles of "name" and "devName" are reversed. That is, "name"
37 * refers to the drive letter name and "devName" refers to the /vicep style
38 * or name. The reason for this is that a lot of places assume that "name"
39 * is the right thing to use to access the partition. Silly of them isn't it?
40 * The NT version of VInitPartition does the intial setup. There is an NT
41 * variant for VGetPartition as well. Also, the VolPartitionInfo RPC does
42 * a swap before sending the data out on the wire.
44 struct DiskPartition {
45 struct DiskPartition *next;
46 char name[32]; /* Mounted partition name */
47 char devName[32]; /* Device mounted on */
48 Device device; /* device number */
49 int lock_fd; /* File descriptor of this partition if locked; otherwise -1;
50 Not used by the file server */
51 int free; /* Total number of blocks (1K) presumed
52 available on this partition (accounting
53 for the minfree parameter for the
54 partition). This is adjusted
55 approximately by the sizes of files
56 and directories read/written, and
57 periodically the superblock is read and
58 this is recomputed. This number can
59 be negative, if the partition starts
61 int totalUsable; /* Total number of blocks available on this
62 partition, taking into account the minfree
63 parameter for the partition (see the
64 4.2bsd command tunefs, but note that the
65 bug mentioned there--that the superblock
66 is not reread--does not apply here. The
67 superblock is re-read periodically by
68 VSetPartitionDiskUsage().) */
69 int minFree; /* Number blocks to be kept free, as last read
70 from the superblock */
72 int f_files; /* total number of files in this partition */
74 #define PART_DONTUPDATE 1
75 #define PART_DUPLICATE 2 /* NT - used if we find more than one partition
76 * using the same drive. Will be dumped before
77 * all partitions attached.
81 #include <WINNT/vptab.h>
82 extern int VValidVPTEntry(struct vptab *vptp);
86 extern struct DiskPartition *DiskPartitionList;
87 extern struct DiskPartition *VGetPartition();
88 extern int VAttachPartitions(void);
89 extern void VLockPartition(char *name);
90 extern void VLockPartition_r(char *name);
91 extern void VUnlockPartition(char *name);
92 extern void VUnlockPartition_r(char *name);
93 extern void VResetDiskUsage(void);
94 extern void VResetDiskUsage_r(void);
95 extern void VSetPartitionDiskUsage(register struct DiskPartition *dp);
96 extern void VSetPartitionDiskUsage_r(register struct DiskPartition *dp);
97 extern char *VPartitionPath(struct DiskPartition *p);
98 /*extern void VAdjustDiskUsage(Error *ec, Volume *vp, afs_int32 blocks,
99 afs_int32 checkBlocks); */
100 extern void VPrintDiskStats(void);