2003-05-12 03:44:26 +04:00
/*
2003-05-12 05:20:17 +04:00
Unix SMB / CIFS implementation .
SYS QUOTA code constants
Copyright ( C ) Stefan ( metze ) Metzmacher 2003
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2003-05-12 05:20:17 +04:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 09:23:25 +04:00
along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2003-05-12 03:44:26 +04:00
*/
2003-05-12 05:20:17 +04:00
2003-05-12 03:44:26 +04:00
# ifndef _SYSQUOTAS_H
# define _SYSQUOTAS_H
2003-05-12 05:20:17 +04:00
# ifdef HAVE_SYS_QUOTAS
# if defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT)
# include <mntent.h>
# define HAVE_MNTENT 1
/*#endif defined(HAVE_MNTENT_H)&&defined(HAVE_SETMNTENT)&&defined(HAVE_GETMNTENT)&&defined(HAVE_ENDMNTENT) */
# elif defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM)
# include <devnm.h>
# endif /* defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM) */
2003-05-12 03:44:26 +04:00
2003-05-12 05:20:17 +04:00
# endif /* HAVE_SYS_QUOTAS */
2003-05-12 03:44:26 +04:00
2003-05-14 18:38:11 +04:00
2003-05-12 03:44:26 +04:00
/**************************************************
Some stuff for the sys_quota api .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-10-14 03:59:36 +04:00
# define SMB_QUOTAS_NO_LIMIT ((uint64_t)(0))
# define SMB_QUOTAS_NO_SPACE ((uint64_t)(1))
2003-05-12 03:44:26 +04:00
2003-07-29 22:07:13 +04:00
# define SMB_QUOTAS_SET_NO_LIMIT(dp) \
{ \
( dp ) - > softlimit = SMB_QUOTAS_NO_LIMIT ; \
( dp ) - > hardlimit = SMB_QUOTAS_NO_LIMIT ; \
( dp ) - > isoftlimit = SMB_QUOTAS_NO_LIMIT ; \
( dp ) - > ihardlimit = SMB_QUOTAS_NO_LIMIT ; \
}
# define SMB_QUOTAS_SET_NO_SPACE(dp) \
{ \
( dp ) - > softlimit = SMB_QUOTAS_NO_SPACE ; \
( dp ) - > hardlimit = SMB_QUOTAS_NO_SPACE ; \
( dp ) - > isoftlimit = SMB_QUOTAS_NO_SPACE ; \
( dp ) - > ihardlimit = SMB_QUOTAS_NO_SPACE ; \
}
2003-05-12 03:44:26 +04:00
typedef struct _SMB_DISK_QUOTA {
enum SMB_QUOTA_TYPE qtype ;
2008-10-14 03:59:36 +04:00
uint64_t bsize ;
uint64_t hardlimit ; /* In bsize units. */
uint64_t softlimit ; /* In bsize units. */
uint64_t curblocks ; /* In bsize units. */
uint64_t ihardlimit ; /* inode hard limit. */
uint64_t isoftlimit ; /* inode soft limit. */
uint64_t curinodes ; /* Current used inodes. */
uint32_t qflags ;
2003-05-12 03:44:26 +04:00
} SMB_DISK_QUOTA ;
2004-01-05 22:36:02 +03:00
# ifndef QUOTABLOCK_SIZE
# define QUOTABLOCK_SIZE 1024
# endif
2003-05-12 03:44:26 +04:00
# endif /*_SYSQUOTAS_H */