4 #include <netatalk/endian.h>
8 #if defined( sun ) && !defined( __svr4__ )
12 #endif /*sun __svr4__*/
14 #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 )
16 #endif /* HAVE_SYS_VFS_H || sun || ibm032 */
18 #if defined(_IBMR2) || defined(HAVE_STATFS_H)
19 #include <sys/statfs.h>
20 /* this might not be right. */
21 #define f_mntfromname f_fname
22 #endif /* _IBMR2 || HAVE_STATFS_H */
25 #define f_frsize f_fsize
27 /* temp fix, was: defined(HAVE_SYS_STATVFS) || defined(__svr4__) */
28 #if defined(__svr4__) || (defined(__NetBSD__) && (__NetBSD_Version__ >= 200040000))
29 #include <sys/statvfs.h>
30 #define statfs statvfs
31 #else /* HAVE_SYS_STATVFS || __svr4__ */
32 #define f_frsize f_bsize
33 #endif /* USE_STATVFS_H */
36 #if defined(__svr4__) || defined(HAVE_SYS_MNTTAB_H)
37 #include <sys/mnttab.h>
38 #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */
40 #if defined(__DragonFly__)
41 #define dqblk ufs_dqblk
44 #if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || \
45 defined(linux) || defined(ultrix)
46 #include <sys/mount.h>
47 #endif /* HAVE_SYS_MOUNT_H || BSD4_4 || linux || ultrix */
49 #if defined(linux) || defined(HAVE_MNTENT_H)
51 #endif /* linux || HAVE_MNTENT_H */
54 #ifndef NO_QUOTA_SUPPORT
56 #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT))
57 #define dqb_btimelimit dqb_btime
58 #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */
60 #if defined(linux) || defined(ultrix) || defined(HAVE_QUOTA_H)
61 #ifndef NEED_QUOTACTL_WRAPPER
62 /*#include <sys/quota.h>*/
63 /*long quotactl (int, const char *, unsigned int, caddr_t); */
64 /* extern long quotactl (int, const char *, long, caddr_t); */
66 #else /* ! NEED_QUOTACTL_WRAPPER */
67 #include <asm/types.h>
68 #include <asm/unistd.h>
69 #include <linux/quota.h>
70 #endif /* ! NEED_QUOTACTL_WRAPPER */
71 #endif /* linux || ultrix || HAVE_QUOTA_H */
74 #include <sys/fs/ufs_quota.h>
78 #include <ufs/ufs/quota.h>
81 #ifdef HAVE_UFS_QUOTA_H
82 #include <ufs/quota.h>
83 #endif /* HAVE_UFS_QUOTA_H */
86 #include <jfs/quota.h>
90 #include <sys/types.h>
92 #include "directory.h"
99 /* definitions from sys/quota.h */
100 #define USRQUOTA 0 /* element used for user quotas */
101 #define GRPQUOTA 1 /* element used for group quotas */
104 * Command definitions for the 'quotactl' system call.
105 * The commands are broken into a main command defined below
106 * and a subcommand that is used to convey the type of
107 * quota that is being manipulated (see above).
109 #define SUBCMDMASK 0x00ff
110 #define SUBCMDSHIFT 8
111 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
113 /* declare an internal version of the quota block struct */
114 typedef u_int64_t qsize_t; /* Type in which we store size limitations */
115 typedef u_int32_t qid_t; /* Type in which we store ids in memory */
119 qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */
120 qsize_t dqb_isoftlimit; /* preferred inode limit */
121 qsize_t dqb_curinodes; /* current # allocated inodes */
122 qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
123 qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */
124 qsize_t dqb_curblocks; /* current block count */
125 time_t dqb_btime; /* time limit for excessive disk use */
126 time_t dqb_itime; /* time limit for excessive inode use */
129 /* API v1 command definitions */
130 #define Q_V1_GETQUOTA 0x0300
131 #define Q_V1_SYNC 0x0600
132 #define Q_V1_SETQLIM 0x0700
133 #define Q_V1_GETSTATS 0x0800
134 /* API v2 command definitions */
135 #define Q_V2_SYNC 0x0600
136 #define Q_V2_SETQLIM 0x0700
137 #define Q_V2_GETQUOTA 0x0D00
138 #define Q_V2_GETSTATS 0x1100
139 /* proc API command definitions */
140 #define Q_V3_SYNC 0x800001
141 #define Q_V3_GETQUOTA 0x800007
142 #define Q_V3_SETQUOTA 0x800008
144 /* Interface versions */
145 #define IFACE_UNSET 0
146 #define IFACE_VFSOLD 1
147 #define IFACE_VFSV0 2
148 #define IFACE_GENERIC 3
150 #define DEV_QBSIZE 1024
153 u_int64_t dqb_bhardlimit;
154 u_int64_t dqb_bsoftlimit;
155 u_int64_t dqb_curspace;
156 u_int64_t dqb_ihardlimit;
157 u_int64_t dqb_isoftlimit;
158 u_int64_t dqb_curinodes;
165 unsigned int dqb_ihardlimit;
166 unsigned int dqb_isoftlimit;
167 unsigned int dqb_curinodes;
168 unsigned int dqb_bhardlimit;
169 unsigned int dqb_bsoftlimit;
170 qsize_t dqb_curspace;
180 u_int32_t cache_hits;
181 u_int32_t allocated_dquots;
182 u_int32_t free_dquots;
188 u_int32_t dqb_bhardlimit;
189 u_int32_t dqb_bsoftlimit;
190 u_int32_t dqb_curblocks;
191 u_int32_t dqb_ihardlimit;
192 u_int32_t dqb_isoftlimit;
193 u_int32_t dqb_curinodes;
198 extern long quotactl (unsigned int, const char *, int, caddr_t);
204 extern int getnfsquota (struct vol *, const int, const u_int32_t,
207 extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *,
209 #endif /* NO_QUOTA_SUPPORT */
211 extern struct afp_options default_options;
213 extern int gmem (const gid_t);
214 extern int setdeskmode (const mode_t);
215 extern int setdirunixmode (const struct vol *, const char *, mode_t);
216 extern int setdirmode (const struct vol *, const char *, mode_t);
217 extern int setdeskowner (const uid_t, const gid_t);
218 extern int setdirowner (const struct vol *, const char *, const uid_t, const gid_t);
219 extern int setfilunixmode (const struct vol *, struct path*, const mode_t);
220 extern int setfilowner (const struct vol *, const uid_t, const gid_t, struct path*);
221 extern void accessmode (char *, struct maccess *, struct dir *, struct stat *);
224 #define accessmode afsmode