9 #if defined( sun ) && !defined( __svr4__ )
13 #endif /*sun __svr4__*/
15 #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 )
17 #endif /* HAVE_SYS_VFS_H || sun || ibm032 */
19 #if defined(_IBMR2) || defined(HAVE_STATFS_H)
20 #include <sys/statfs.h>
21 /* this might not be right. */
22 #define f_mntfromname f_fname
23 #endif /* _IBMR2 || HAVE_STATFS_H */
26 #define f_frsize f_fsize
28 /* temp fix, was: defined(HAVE_SYS_STATVFS) || defined(__svr4__) */
29 #if defined(__svr4__) || (defined(__NetBSD__) && (__NetBSD_Version__ >= 200040000))
30 #include <sys/statvfs.h>
31 #define statfs statvfs
32 #else /* HAVE_SYS_STATVFS || __svr4__ */
33 #define f_frsize f_bsize
34 #endif /* USE_STATVFS_H */
37 #if defined(__svr4__) || defined(HAVE_SYS_MNTTAB_H)
38 #include <sys/mnttab.h>
39 #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */
41 #if defined(__DragonFly__)
42 #define dqblk ufs_dqblk
45 #if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || \
46 defined(linux) || defined(ultrix)
47 #include <sys/mount.h>
48 #endif /* HAVE_SYS_MOUNT_H || BSD4_4 || linux || ultrix */
50 #if defined(linux) || defined(HAVE_MNTENT_H)
52 #endif /* linux || HAVE_MNTENT_H */
55 #ifndef NO_QUOTA_SUPPORT
57 #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT))
58 #define dqb_btimelimit dqb_btime
59 #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */
61 #if defined(linux) || defined(ultrix) || defined(HAVE_QUOTA_H)
62 #ifndef NEED_QUOTACTL_WRAPPER
63 /*#include <sys/quota.h>*/
64 /*long quotactl (int, const char *, unsigned int, caddr_t); */
65 /* extern long quotactl (int, const char *, long, caddr_t); */
67 #else /* ! NEED_QUOTACTL_WRAPPER */
68 #include <asm/types.h>
69 #include <asm/unistd.h>
70 #include <linux/quota.h>
71 #endif /* ! NEED_QUOTACTL_WRAPPER */
72 #endif /* linux || ultrix || HAVE_QUOTA_H */
75 #include <sys/fs/ufs_quota.h>
79 #include <ufs/ufs/quota.h>
82 #ifdef HAVE_UFS_QUOTA_H
83 #include <ufs/quota.h>
84 #endif /* HAVE_UFS_QUOTA_H */
87 #include <jfs/quota.h>
91 #include <sys/types.h>
93 #include "directory.h"
100 /* definitions from sys/quota.h */
101 #define USRQUOTA 0 /* element used for user quotas */
102 #define GRPQUOTA 1 /* element used for group quotas */
105 * Command definitions for the 'quotactl' system call.
106 * The commands are broken into a main command defined below
107 * and a subcommand that is used to convey the type of
108 * quota that is being manipulated (see above).
110 #define SUBCMDMASK 0x00ff
111 #define SUBCMDSHIFT 8
112 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
114 /* declare an internal version of the quota block struct */
115 typedef u_int64_t qsize_t; /* Type in which we store size limitations */
116 typedef u_int32_t qid_t; /* Type in which we store ids in memory */
120 qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */
121 qsize_t dqb_isoftlimit; /* preferred inode limit */
122 qsize_t dqb_curinodes; /* current # allocated inodes */
123 qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
124 qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */
125 qsize_t dqb_curblocks; /* current block count */
126 time_t dqb_btime; /* time limit for excessive disk use */
127 time_t dqb_itime; /* time limit for excessive inode use */
130 /* API v1 command definitions */
131 #define Q_V1_GETQUOTA 0x0300
132 #define Q_V1_SYNC 0x0600
133 #define Q_V1_SETQLIM 0x0700
134 #define Q_V1_GETSTATS 0x0800
135 /* API v2 command definitions */
136 #define Q_V2_SYNC 0x0600
137 #define Q_V2_SETQLIM 0x0700
138 #define Q_V2_GETQUOTA 0x0D00
139 #define Q_V2_GETSTATS 0x1100
140 /* proc API command definitions */
141 #define Q_V3_SYNC 0x800001
142 #define Q_V3_GETQUOTA 0x800007
143 #define Q_V3_SETQUOTA 0x800008
145 /* Interface versions */
146 #define IFACE_UNSET 0
147 #define IFACE_VFSOLD 1
148 #define IFACE_VFSV0 2
149 #define IFACE_GENERIC 3
151 #define DEV_QBSIZE 1024
154 u_int64_t dqb_bhardlimit;
155 u_int64_t dqb_bsoftlimit;
156 u_int64_t dqb_curspace;
157 u_int64_t dqb_ihardlimit;
158 u_int64_t dqb_isoftlimit;
159 u_int64_t dqb_curinodes;
166 unsigned int dqb_ihardlimit;
167 unsigned int dqb_isoftlimit;
168 unsigned int dqb_curinodes;
169 unsigned int dqb_bhardlimit;
170 unsigned int dqb_bsoftlimit;
171 qsize_t dqb_curspace;
181 u_int32_t cache_hits;
182 u_int32_t allocated_dquots;
183 u_int32_t free_dquots;
189 u_int32_t dqb_bhardlimit;
190 u_int32_t dqb_bsoftlimit;
191 u_int32_t dqb_curblocks;
192 u_int32_t dqb_ihardlimit;
193 u_int32_t dqb_isoftlimit;
194 u_int32_t dqb_curinodes;
199 extern long quotactl (unsigned int, const char *, int, caddr_t);
205 extern int getnfsquota (struct vol *, const int, const u_int32_t,
208 extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *,
210 #endif /* NO_QUOTA_SUPPORT */
212 extern struct afp_options default_options;
214 extern int gmem (const gid_t);
215 extern int setdeskmode (const mode_t);
216 extern int setdirunixmode (const struct vol *, const char *, mode_t);
217 extern int setdirmode (const struct vol *, const char *, mode_t);
218 extern int setdeskowner (const uid_t, const gid_t);
219 extern int setdirowner (const struct vol *, const char *, const uid_t, const gid_t);
220 extern int setfilunixmode (const struct vol *, struct path*, const mode_t);
221 extern int setfilowner (const struct vol *, const uid_t, const gid_t, struct path*);
222 extern void accessmode (char *, struct maccess *, struct dir *, struct stat *);
225 #define accessmode afsmode