From 2018fcd277f7cc2212f3eda574faf14aed4819e8 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 11 May 2003 23:44:26 +0000 Subject: Add new files needed for VFS fixes. 1. idmap.h is used for unid_t only, agreed by Simo 2. sysquotas.h is used to add quota support to VFS layer and is needed for future NT quota commit 3. vfs_macros.h provides convenient macros to access VFS API. (This used to be commit 1dd578635913c8340cfc565d7e0c8c5086070084) --- source3/include/sysquotas.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source3/include/sysquotas.h (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h new file mode 100644 index 0000000000..9513110a6a --- /dev/null +++ b/source3/include/sysquotas.h @@ -0,0 +1,44 @@ +/* + 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 + the Free Software Foundation; either version 2 of the License, or + (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 + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _SYSQUOTAS_H +#define _SYSQUOTAS_H + + +/************************************************** + Some stuff for the sys_quota api. + **************************************************/ + +#define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0)) +#define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1)) + +typedef struct _SMB_DISK_QUOTA { + enum SMB_QUOTA_TYPE qtype; + SMB_BIG_UINT bsize; + SMB_BIG_UINT hardlimit; /* In bsize units. */ + SMB_BIG_UINT softlimit; /* In bsize units. */ + SMB_BIG_UINT curblocks; /* In bsize units. */ + SMB_BIG_UINT ihardlimit; /* inode hard limit. */ + SMB_BIG_UINT isoftlimit; /* inode soft limit. */ + SMB_BIG_UINT curinodes; /* Current used inodes. */ + uint32 qflags; +} SMB_DISK_QUOTA; + +#endif /*_SYSQUOTAS_H */ -- cgit From e8573c8fa928602fd979d5ac45c692e7464f0aad Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 12 May 2003 01:20:17 +0000 Subject: Add NT quota support. Patch from Stefan (metze) Metzemacher 1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab 2. Disabled by default and when requested, will be probed and enabled only on Linux where it works 3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far Documentation to follow (This used to be commit 4bf022ce9e45be85609426762ba2644ac2031326) --- source3/include/sysquotas.h | 191 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 173 insertions(+), 18 deletions(-) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index 9513110a6a..46a265ed17 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -1,26 +1,181 @@ /* - 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 - the Free Software Foundation; either version 2 of the License, or - (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 - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + 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 + the Free Software Foundation; either version 2 of the License, or + (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 + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #ifndef _SYSQUOTAS_H #define _SYSQUOTAS_H + +#ifdef HAVE_SYS_QUOTAS + +/* Sometimes we need this on linux for linux/quota.h */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_ASM_TYPES_H +#include +#endif + +/* + * This shouldn't be neccessary - it should be /usr/include/sys/quota.h + * Unfortunately, RH7.1 ships with a different quota system using struct mem_dqblk + * rather than the struct dqblk defined in /usr/include/sys/quota.h. + * This means we must include linux/quota.h to have a hope of working on + * RH7.1 systems. And it also means this breaks if the kernel is upgraded + * to a Linus 2.4.x (where x > the minor number shipped with RH7.1) until + * Linus synchronises with the AC patches. Sometimes I *hate* Linux :-). JRA. + */ +#ifdef HAVE_LINUX_QUOTA_H +#include +#elif defined(HAVE_SYS_QUOTA_H) +#include +#endif + +#if defined(HAVE_STRUCT_IF_DQBLK) +# define SYS_DQBLK if_dqblk +# define dqb_curblocks dqb_curspace/bsize +#elif defined(HAVE_STRUCT_MEM_DQBLK) +# define SYS_DQBLK mem_dqblk +# define dqb_curblocks dqb_curspace/bsize +#else /* STRUCT_DQBLK */ +# define SYS_DQBLK dqblk +#endif + +#ifndef Q_SETQLIM +#define Q_SETQLIM Q_SETQUOTA +#endif + +/********************************************* + check for XFS QUOTA MANAGER + *********************************************/ +/* on linux */ +#ifdef HAVE_LINUX_XQM_H +# include +# define HAVE_XFS_QUOTA +#else +# ifdef HAVE_XFS_XQM_H +# include +# define HAVE_XFS_QUOTA +# else +# ifdef HAVE_LINUX_DQBLK_XFS_H +# include +# define HAVE_XFS_QUOTA +# endif +# endif +#endif +/* on IRIX */ +#ifdef Q_XGETQUOTA +# ifndef HAVE_XFS_QUOTA +# define HAVE_XFS_QUOTA +# ifndef Q_XQUOTAON +# define Q_XQUOTAON Q_QUOTAON +# endif /* Q_XQUOTAON */ +# ifndef Q_XQUOTAOFF +# define Q_XQUOTAOFF Q_QUOTAOFF +# endif /* Q_XQUOTAOFF */ +# ifndef Q_XGETQSTAT +# define Q_XGETQSTAT Q_GETQSTAT +# endif /* Q_XGETQSTAT */ +# endif /* HAVE_XFS_QUOTA */ +#endif /* Q_XGETQUOTA */ + +#ifdef HAVE_XFS_QUOTA +/* Linux has BBSIZE in + * or + * IRIX has BBSIZE in + */ +#ifdef HAVE_LINUX_XFS_FS_H +#include +#elif defined(HAVE_XFS_XFS_FS_H) +#include +#endif /* *_XFS_FS_H */ + +#ifndef BBSHIFT +#define BBSHIFT 9 +#endif /* BBSHIFT */ +#ifndef BBSIZE +#define BBSIZE (1< +#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 +#endif /* defined(HAVE_DEVNM_H)&&defined(HAVE_DEVNM) */ +#endif /* HAVE_SYS_QUOTAS */ /************************************************** Some stuff for the sys_quota api. -- cgit From 2c01eef4d7ea9ed57ea5f68a0e75559e101fd26f Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 14 May 2003 14:38:11 +0000 Subject: Evolve quotas configure check more. Patch from Stefan (metze) Metzemacher. Now we are defaulting to --with-quotas=no but anyway trying to test them in configure. This is done to get information about as much quota API variations as possible -- when --with-quotas=no this does not affect build but provides us with more detailed information on build farm. (This used to be commit 3786695c72e6ff6a52a527382ac77142e236971b) --- source3/include/sysquotas.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index 46a265ed17..cfdac0609a 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -177,6 +177,11 @@ #endif /* HAVE_SYS_QUOTAS */ + +#ifndef QUOTABLOCK_SIZE +#define QUOTABLOCK_SIZE 1024 +#endif + /************************************************** Some stuff for the sys_quota api. **************************************************/ -- cgit From 428653ef7257240e9318f5fed71869f0124ff379 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 29 Jul 2003 18:07:13 +0000 Subject: Add NT quotas support. Users allowed now to manage quotas on systems with sysquotas interface detected (Linux at least) using native Windows tools. Also move default quota support for NT quotas to VFS module default_quota. Code by Metze (This used to be commit e856a96c2c42c39843e5e1a3a6b0d538e7179900) --- source3/include/sysquotas.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index cfdac0609a..b803e6277a 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -189,6 +189,22 @@ #define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0)) #define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1)) +#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;\ +} + typedef struct _SMB_DISK_QUOTA { enum SMB_QUOTA_TYPE qtype; SMB_BIG_UINT bsize; -- cgit From 31876a8478fc16dc7ac62ca835714098398f56e4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Jan 2004 19:36:02 +0000 Subject: Patch from Stefan (metze) Metzmacher to revert to 2.2.x quota methods. :-). "here's a patch which ports the samba 2.2 samba_linux_quota.h stuff to 3_0. This is needed because of so many broken quota files outthere. Please, test this with old, new kernels (strucr dqblk, struct mem_dqblk, and struct if_dqblk) , quota.user, aquota.user formats what is when a user is over soft quota and over hard quotas..." Jeremy. (This used to be commit 4350aa6ce6cfdaf71cdcfd2aebcdc9560fa7efcf) --- source3/include/sysquotas.h | 152 ++------------------------------------------ 1 file changed, 4 insertions(+), 148 deletions(-) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index b803e6277a..bfb9466b39 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -23,150 +23,6 @@ #ifdef HAVE_SYS_QUOTAS -/* Sometimes we need this on linux for linux/quota.h */ -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_ASM_TYPES_H -#include -#endif - -/* - * This shouldn't be neccessary - it should be /usr/include/sys/quota.h - * Unfortunately, RH7.1 ships with a different quota system using struct mem_dqblk - * rather than the struct dqblk defined in /usr/include/sys/quota.h. - * This means we must include linux/quota.h to have a hope of working on - * RH7.1 systems. And it also means this breaks if the kernel is upgraded - * to a Linus 2.4.x (where x > the minor number shipped with RH7.1) until - * Linus synchronises with the AC patches. Sometimes I *hate* Linux :-). JRA. - */ -#ifdef HAVE_LINUX_QUOTA_H -#include -#elif defined(HAVE_SYS_QUOTA_H) -#include -#endif - -#if defined(HAVE_STRUCT_IF_DQBLK) -# define SYS_DQBLK if_dqblk -# define dqb_curblocks dqb_curspace/bsize -#elif defined(HAVE_STRUCT_MEM_DQBLK) -# define SYS_DQBLK mem_dqblk -# define dqb_curblocks dqb_curspace/bsize -#else /* STRUCT_DQBLK */ -# define SYS_DQBLK dqblk -#endif - -#ifndef Q_SETQLIM -#define Q_SETQLIM Q_SETQUOTA -#endif - -/********************************************* - check for XFS QUOTA MANAGER - *********************************************/ -/* on linux */ -#ifdef HAVE_LINUX_XQM_H -# include -# define HAVE_XFS_QUOTA -#else -# ifdef HAVE_XFS_XQM_H -# include -# define HAVE_XFS_QUOTA -# else -# ifdef HAVE_LINUX_DQBLK_XFS_H -# include -# define HAVE_XFS_QUOTA -# endif -# endif -#endif -/* on IRIX */ -#ifdef Q_XGETQUOTA -# ifndef HAVE_XFS_QUOTA -# define HAVE_XFS_QUOTA -# ifndef Q_XQUOTAON -# define Q_XQUOTAON Q_QUOTAON -# endif /* Q_XQUOTAON */ -# ifndef Q_XQUOTAOFF -# define Q_XQUOTAOFF Q_QUOTAOFF -# endif /* Q_XQUOTAOFF */ -# ifndef Q_XGETQSTAT -# define Q_XGETQSTAT Q_GETQSTAT -# endif /* Q_XGETQSTAT */ -# endif /* HAVE_XFS_QUOTA */ -#endif /* Q_XGETQUOTA */ - -#ifdef HAVE_XFS_QUOTA -/* Linux has BBSIZE in - * or - * IRIX has BBSIZE in - */ -#ifdef HAVE_LINUX_XFS_FS_H -#include -#elif defined(HAVE_XFS_XFS_FS_H) -#include -#endif /* *_XFS_FS_H */ - -#ifndef BBSHIFT -#define BBSHIFT 9 -#endif /* BBSHIFT */ -#ifndef BBSIZE -#define BBSIZE (1< #define HAVE_MNTENT 1 @@ -178,10 +34,6 @@ #endif /* HAVE_SYS_QUOTAS */ -#ifndef QUOTABLOCK_SIZE -#define QUOTABLOCK_SIZE 1024 -#endif - /************************************************** Some stuff for the sys_quota api. **************************************************/ @@ -217,4 +69,8 @@ typedef struct _SMB_DISK_QUOTA { uint32 qflags; } SMB_DISK_QUOTA; +#ifndef QUOTABLOCK_SIZE +#define QUOTABLOCK_SIZE 1024 +#endif + #endif /*_SYSQUOTAS_H */ -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/sysquotas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index bfb9466b39..e014c21f8b 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/include/sysquotas.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/sysquotas.h') diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h index e014c21f8b..a0754a3737 100644 --- a/source3/include/sysquotas.h +++ b/source3/include/sysquotas.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program; if not, see . */ #ifndef _SYSQUOTAS_H -- cgit