From 24013bda4526b1f1cb1c245da83f290210f6e6bc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 13 Jun 2012 12:20:07 +1000 Subject: build: Remove Unicos support (quota in particular) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source3/smbd/quotas.c | 89 --------------------------------------------------- 1 file changed, 89 deletions(-) (limited to 'source3/smbd/quotas.c') diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index d8bdb0225c..10b05562af 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -489,95 +489,6 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d return (True); } -#elif defined(CRAY) - -#include -#include - -/**************************************************************************** -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) #include -- cgit