CVS update: samba/source/include
Alexander Bokovoy
a.bokovoy at sam-solutions.net
Thu Jun 6 19:03:14 EST 2002
On Wed, Jun 05, 2002 at 06:25:35PM -0700, Jeremy Allison wrote:
>
> Date: Wed Jun 5 18:25:35 2002
> Author: jra
>
> Update of /data/cvs/samba/source/include
> In directory va:/tmp/cvs-serv19601/include
>
> Added Files:
> Tag: SAMBA_2_2
> samba_linux_quota.h
> Log Message:
> Getting ready to add nasty quota support.... We need all this system
> header *crap* that should be in glibc. I'm not happy :-(.
> Jeremy.
This still does not allow to compile Samba against Jan Kara's quotas in
Cox's 2.4-ac series. Patch attached.
--
/ Alexander Bokovoy
Software architect and analyst // SaM-Solutions Ltd.
---
Having children is like having a bowling alley installed in your brain.
-- Martin Mull
-------------- next part --------------
diff -urNk.orig ./source/configure.in.orig ./source/configure.in
--- ./source/configure.in.orig Mon Apr 1 18:08:04 2002
+++ ./source/configure.in Tue Apr 2 18:29:07 2002
@@ -2259,7 +2259,18 @@
#include <mntent.h>
#include <linux/unistd.h>],[struct mem_dqblk D;],
samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
-if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
+ # Check for kernel 2.4.x Jan Kara quota ...
+ AC_CACHE_CHECK([for linux 2.4.x Jan Kara 32-bit quota ..],samba_cv_linux_2_4_quota_jan_kara, [
+ AC_TRY_COMPILE([#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <linux/quota.h>
+#include <mntent.h>
+#include <linux/unistd.h>],[struct if_dqblk D;],
+ samba_cv_linux_2_4_quota_jan_kara=yes,samba_cv_linux_2_4_quota_jan_kara=no)])
+if test x"$samba_cv_linux_2_4_quota_jan_kara" = x"yes"; then
+ AC_DEFINE(LINUX_QUOTAS_IF)
+elif test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
AC_DEFINE(LINUX_QUOTAS_2)
else
AC_DEFINE(LINUX_QUOTAS_1)
diff -urNk.orig ./source/smbd/quotas.c.orig ./source/smbd/quotas.c
--- ./source/smbd/quotas.c.orig Wed Jan 30 14:21:04 2002
+++ ./source/smbd/quotas.c Tue Apr 2 18:36:52 2002
@@ -62,7 +62,10 @@
#include <linux/unistd.h>
+#ifndef LINUX_QUOTAS_IF
#define LINUX_QUOTAS_2
+#define LINUX_QUOTAS_IF
+#endif
typedef struct _LINUX_SMB_DISK_QUOTA {
SMB_BIG_UINT bsize;
@@ -106,19 +109,24 @@
static int get_smb_linux_vfs_quota(char *path, uid_t euser_id, LINUX_SMB_DISK_QUOTA *dp)
{
int ret;
+#ifndef LINUX_QUOTAS_IF
#ifdef LINUX_QUOTAS_1
struct dqblk D;
ZERO_STRUCT(D);
dp->bsize = (SMB_BIG_UINT)1024;
-#else /* LINUX_QUOTAS_2 */
+#else
struct mem_dqblk D;
+#endif
+#else /* LINUX_QUOTAS_IF */
+ struct if_dqblk D;
+#endif
+#ifdef LINUX_QUOTAS_IF || LINUX_QUOTAS_2
ZERO_STRUCT(D);
#ifndef QUOTABLOCK_SIZE
#define QUOTABLOCK_SIZE 1024
#endif
dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
#endif
-
if ((ret = quotactl(QCMD(Q_GETQUOTA,USRQUOTA), path, euser_id, (caddr_t)&D)))
return -1;
@@ -128,9 +136,14 @@
dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
+#ifndef LINUX_QUOTAS_IF
#ifdef LINUX_QUOTAS_1
dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
-#else /* LINUX_QUOTAS_2 */
+#endif
+#endif
+
+#ifdef LINUX_QUOTAS_IF || LINUX_QUOTAS_2
+ /* LINUX_QUOTAS_2 and LINUX_QUOTAS_IF */
dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace)/ dp->bsize;
#endif
More information about the samba-cvs
mailing list