mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
build: Remove Unicos support (quota in particular)
Unicos machines are long gone now (Cray now make Linux compute nodes), so remove the quota support. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
This commit is contained in:
parent
b7b0d7d868
commit
24013bda45
@ -499,13 +499,6 @@ case "$host_os" in
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
#
|
|
||||||
# CRAY Unicos has broken const handling
|
|
||||||
*unicos*)
|
|
||||||
AC_MSG_RESULT([disabling const])
|
|
||||||
CPPFLAGS="$CPPFLAGS -Dconst="
|
|
||||||
;;
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# AIX4.x doesn't even admit to having large
|
# AIX4.x doesn't even admit to having large
|
||||||
# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
|
# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
|
||||||
@ -4721,22 +4714,6 @@ if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
|
|
||||||
AC_CACHE_CHECK([for CRAY int quotactl (char *spec, int request, char *arg)],samba_cv_HAVE_QUOTACTL_3,[
|
|
||||||
AC_TRY_RUN_STRICT([
|
|
||||||
#define HAVE_QUOTACTL_3 1
|
|
||||||
#define AUTOCONF_TEST 1
|
|
||||||
#include "confdefs.h"
|
|
||||||
#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
|
|
||||||
samba_cv_HAVE_QUOTACTL_3=yes,samba_cv_HAVE_QUOTACTL_3=no,samba_cv_HAVE_QUOTACTL_3=cross)])
|
|
||||||
if test x"$samba_cv_HAVE_QUOTACTL_3" = x"yes"; then
|
|
||||||
echo "CRAY int quotactl (char *spec, int request, char *arg) is NOT reworked for the sys_quota api"
|
|
||||||
samba_cv_SYSQUOTA_FOUND=yes;
|
|
||||||
AC_DEFINE(HAVE_QUOTACTL_3,1,[Whether CRAY int quotactl (char *spec, int request, char *arg); is available])
|
|
||||||
samba_cv_sysquotas_file="lib/sysquotas_3.c"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([for NFS QUOTAS],samba_cv_HAVE_NFS_QUOTAS,[
|
AC_CACHE_CHECK([for NFS QUOTAS],samba_cv_HAVE_NFS_QUOTAS,[
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
|
@ -489,95 +489,6 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d
|
|||||||
return (True);
|
return (True);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(CRAY)
|
|
||||||
|
|
||||||
#include <sys/quota.h>
|
|
||||||
#include <mntent.h>
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
try to get the disk space from disk quotas (CRAY VERSION)
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
|
|
||||||
{
|
|
||||||
struct mntent *mnt;
|
|
||||||
FILE *fd;
|
|
||||||
SMB_STRUCT_STAT sbuf;
|
|
||||||
SMB_DEV_T devno ;
|
|
||||||
struct q_request request ;
|
|
||||||
struct qf_header header ;
|
|
||||||
int quota_default = 0 ;
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (sys_stat(path, &sbuf, false) == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
devno = sbuf.st_ex_dev ;
|
|
||||||
|
|
||||||
if ((fd = setmntent(KMTAB)) == NULL) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((mnt = getmntent(fd)) != NULL) {
|
|
||||||
if (sys_stat(mnt->mnt_dir, &sbuf, false) == -1) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (sbuf.st_ex_dev == devno) {
|
|
||||||
found = frue ;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
name = talloc_strdup(talloc_tos(), mnt->mnt_dir);
|
|
||||||
endmntent(fd);
|
|
||||||
if (!found) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!name) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
request.qf_magic = QF_MAGIC ;
|
|
||||||
request.qf_entry.id = geteuid() ;
|
|
||||||
|
|
||||||
if (quotactl(name, Q_GETQUOTA, &request) == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!request.user) {
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.qf_entry.user_q.f_quota == QFV_DEFAULT) {
|
|
||||||
if (!quota_default) {
|
|
||||||
if (quotactl(name, Q_GETHEADER, &header) == -1) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
quota_default = header.user_h.def_fq;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*dfree = quota_default;
|
|
||||||
} else if (request.qf_entry.user_q.f_quota == QFV_PREVENT) {
|
|
||||||
*dfree = 0;
|
|
||||||
} else {
|
|
||||||
*dfree = request.qf_entry.user_q.f_quota;
|
|
||||||
}
|
|
||||||
|
|
||||||
*dsize = request.qf_entry.user_q.f_use;
|
|
||||||
|
|
||||||
if (*dfree < *dsize) {
|
|
||||||
*dfree = 0;
|
|
||||||
} else {
|
|
||||||
*dfree -= *dsize;
|
|
||||||
}
|
|
||||||
|
|
||||||
*bsize = 4096 ; /* Cray blocksize */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(SUNOS5) || defined(SUNOS4)
|
#elif defined(SUNOS5) || defined(SUNOS4)
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -65,26 +65,6 @@
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(HAVE_QUOTACTL_3)
|
|
||||||
/* int quotactl (char *spec, int request, char *arg); */
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_QUOTA_H
|
|
||||||
#include <sys/quota.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int autoconf_quota(void)
|
|
||||||
{
|
|
||||||
int ret = -1;
|
|
||||||
struct q_request request;
|
|
||||||
|
|
||||||
ret = quotactl("/", Q_GETQUOTA, &request);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(HAVE_QUOTACTL_2)
|
#elif defined(HAVE_QUOTACTL_2)
|
||||||
|
|
||||||
#error HAVE_QUOTACTL_2 not implemented
|
#error HAVE_QUOTACTL_2 not implemented
|
||||||
|
Loading…
Reference in New Issue
Block a user