1 | /*
|
---|
2 | Unix SMB/CIFS implementation.
|
---|
3 | SYS QUOTA code constants
|
---|
4 | Copyright (C) Stefan (metze) Metzmacher 2003
|
---|
5 |
|
---|
6 | This program is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 3 of the License, or
|
---|
9 | (at your option) any later version.
|
---|
10 |
|
---|
11 | This program is distributed in the hope that it will be useful,
|
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | GNU General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with this program; if not, see <http://www.gnu.org/licenses/>.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef _SYSQUOTAS_H
|
---|
21 | #define _SYSQUOTAS_H
|
---|
22 |
|
---|
23 | #ifdef HAVE_SYS_QUOTAS
|
---|
24 |
|
---|
25 | #if defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT)
|
---|
26 | #include <mntent.h>
|
---|
27 | #define HAVE_MNTENT 1
|
---|
28 | /*#endif defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT) */
|
---|
29 | #elif defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM)
|
---|
30 | #include <devnm.h>
|
---|
31 | #endif /* defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM) */
|
---|
32 |
|
---|
33 | #endif /* HAVE_SYS_QUOTAS */
|
---|
34 |
|
---|
35 |
|
---|
36 | /**************************************************
|
---|
37 | Some stuff for the sys_quota api.
|
---|
38 | **************************************************/
|
---|
39 |
|
---|
40 | #define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0))
|
---|
41 | #define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1))
|
---|
42 |
|
---|
43 | #define SMB_QUOTAS_SET_NO_LIMIT(dp) \
|
---|
44 | {\
|
---|
45 | (dp)->softlimit = SMB_QUOTAS_NO_LIMIT;\
|
---|
46 | (dp)->hardlimit = SMB_QUOTAS_NO_LIMIT;\
|
---|
47 | (dp)->isoftlimit = SMB_QUOTAS_NO_LIMIT;\
|
---|
48 | (dp)->ihardlimit = SMB_QUOTAS_NO_LIMIT;\
|
---|
49 | }
|
---|
50 |
|
---|
51 | #define SMB_QUOTAS_SET_NO_SPACE(dp) \
|
---|
52 | {\
|
---|
53 | (dp)->softlimit = SMB_QUOTAS_NO_SPACE;\
|
---|
54 | (dp)->hardlimit = SMB_QUOTAS_NO_SPACE;\
|
---|
55 | (dp)->isoftlimit = SMB_QUOTAS_NO_SPACE;\
|
---|
56 | (dp)->ihardlimit = SMB_QUOTAS_NO_SPACE;\
|
---|
57 | }
|
---|
58 |
|
---|
59 | typedef struct _SMB_DISK_QUOTA {
|
---|
60 | enum SMB_QUOTA_TYPE qtype;
|
---|
61 | SMB_BIG_UINT bsize;
|
---|
62 | SMB_BIG_UINT hardlimit; /* In bsize units. */
|
---|
63 | SMB_BIG_UINT softlimit; /* In bsize units. */
|
---|
64 | SMB_BIG_UINT curblocks; /* In bsize units. */
|
---|
65 | SMB_BIG_UINT ihardlimit; /* inode hard limit. */
|
---|
66 | SMB_BIG_UINT isoftlimit; /* inode soft limit. */
|
---|
67 | SMB_BIG_UINT curinodes; /* Current used inodes. */
|
---|
68 | uint32 qflags;
|
---|
69 | } SMB_DISK_QUOTA;
|
---|
70 |
|
---|
71 | #ifndef QUOTABLOCK_SIZE
|
---|
72 | #define QUOTABLOCK_SIZE 1024
|
---|
73 | #endif
|
---|
74 |
|
---|
75 | #endif /*_SYSQUOTAS_H */
|
---|