[GLUE] Rsync SAMBA_3_0 SVN r25598 in order to create the v3-0-test branch.
[Samba.git] / source / include / sysquotas.h
blobbfb9466b3928cb86c40a734da26704aad7a0341d
1 /*
2 Unix SMB/CIFS implementation.
3 SYS QUOTA code constants
4 Copyright (C) Stefan (metze) Metzmacher 2003
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 2 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef _SYSQUOTAS_H
22 #define _SYSQUOTAS_H
24 #ifdef HAVE_SYS_QUOTAS
26 #if defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT)
27 #include <mntent.h>
28 #define HAVE_MNTENT 1
29 /*#endif defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT) */
30 #elif defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM)
31 #include <devnm.h>
32 #endif /* defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM) */
34 #endif /* HAVE_SYS_QUOTAS */
37 /**************************************************
38 Some stuff for the sys_quota api.
39 **************************************************/
41 #define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0))
42 #define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1))
44 #define SMB_QUOTAS_SET_NO_LIMIT(dp) \
46 (dp)->softlimit = SMB_QUOTAS_NO_LIMIT;\
47 (dp)->hardlimit = SMB_QUOTAS_NO_LIMIT;\
48 (dp)->isoftlimit = SMB_QUOTAS_NO_LIMIT;\
49 (dp)->ihardlimit = SMB_QUOTAS_NO_LIMIT;\
52 #define SMB_QUOTAS_SET_NO_SPACE(dp) \
54 (dp)->softlimit = SMB_QUOTAS_NO_SPACE;\
55 (dp)->hardlimit = SMB_QUOTAS_NO_SPACE;\
56 (dp)->isoftlimit = SMB_QUOTAS_NO_SPACE;\
57 (dp)->ihardlimit = SMB_QUOTAS_NO_SPACE;\
60 typedef struct _SMB_DISK_QUOTA {
61 enum SMB_QUOTA_TYPE qtype;
62 SMB_BIG_UINT bsize;
63 SMB_BIG_UINT hardlimit; /* In bsize units. */
64 SMB_BIG_UINT softlimit; /* In bsize units. */
65 SMB_BIG_UINT curblocks; /* In bsize units. */
66 SMB_BIG_UINT ihardlimit; /* inode hard limit. */
67 SMB_BIG_UINT isoftlimit; /* inode soft limit. */
68 SMB_BIG_UINT curinodes; /* Current used inodes. */
69 uint32 qflags;
70 } SMB_DISK_QUOTA;
72 #ifndef QUOTABLOCK_SIZE
73 #define QUOTABLOCK_SIZE 1024
74 #endif
76 #endif /*_SYSQUOTAS_H */