Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Remove old (5.99.48 - 5.99.62) libquota interface.



details:   https://anonhg.NetBSD.org/src/rev/5cdabd746cc4
branches:  trunk
changeset: 773411:5cdabd746cc4
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Feb 01 17:52:07 2012 +0000

description:
Remove old (5.99.48 - 5.99.62) libquota interface.

diffstat:

 common/include/quota/quota.h |   15 +--
 lib/libquota/Makefile        |    7 +-
 lib/libquota/getfsquota.c    |   46 -------
 lib/libquota/getnfsquota.c   |  125 --------------------
 lib/libquota/getufsquota.c   |  258 -------------------------------------------
 5 files changed, 2 insertions(+), 449 deletions(-)

diffs (truncated from 491 to 300 lines):

diff -r 3aa37b1a0aca -r 5cdabd746cc4 common/include/quota/quota.h
--- a/common/include/quota/quota.h      Wed Feb 01 17:48:10 2012 +0000
+++ b/common/include/quota/quota.h      Wed Feb 01 17:52:07 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.4 2011/11/25 16:55:05 dholland Exp $ */
+/* $NetBSD: quota.h,v 1.5 2012/02/01 17:52:07 dholland Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -48,17 +48,4 @@
 /* check a quota usage against limits (assumes UFS semantic) */
 int quota_check_limit(uint64_t, uint64_t,  uint64_t, uint64_t, time_t, time_t);
 
-/*
- * retrieve quotas with ufs semantics from vfs, for the given id and class.
- * second argument points to a struct quotaval array of QUOTA_NLIMITS
- * elements.
- */
-int getufsquota(const char *, struct quotaval *, uid_t, const char *);
-
-/* same as above, but for NFS */
-int getnfsquota(const char *, struct quotaval *, uid_t, const char *);
-
-/* call one of the above, if appropriate, after a statvfs(2) */
-int getfsquota(const char *, struct quotaval *, uid_t, const char *);
-
 #endif /* _QUOTA_QUOTA_H_ */
diff -r 3aa37b1a0aca -r 5cdabd746cc4 lib/libquota/Makefile
--- a/lib/libquota/Makefile     Wed Feb 01 17:48:10 2012 +0000
+++ b/lib/libquota/Makefile     Wed Feb 01 17:52:07 2012 +0000
@@ -1,18 +1,13 @@
-#      $NetBSD: Makefile,v 1.7 2012/02/01 05:34:40 dholland Exp $
+#      $NetBSD: Makefile,v 1.8 2012/02/01 17:52:07 dholland Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/4/93
 
 .include <bsd.own.mk>
 
-.include "${NETBSDSRCDIR}/common/lib/libquota/Makefile.inc"
-
 WARNS= 4
 LIB=   quota
 
-LIBDPLIBS+=     prop  ${.CURDIR}/../libprop
 LIBDPLIBS+=     rpcsvc  ${.CURDIR}/../librpcsvc
 
-SRCS+= getfsquota.c getnfsquota.c getufsquota.c
-
 SRCS+= quota_open.c
 SRCS+= quota_schema.c
 SRCS+= quota_get.c quota_put.c quota_delete.c
diff -r 3aa37b1a0aca -r 5cdabd746cc4 lib/libquota/getfsquota.c
--- a/lib/libquota/getfsquota.c Wed Feb 01 17:48:10 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*     $NetBSD: getfsquota.c,v 1.4 2012/01/09 15:31:11 dholland Exp $ */
-
-/*-
-  * Copyright (c) 2011 Manuel Bouyer
-  * All rights reserved.
-  *
-  * Redistribution and use in source and binary forms, with or without
-  * modification, are permitted provided that the following conditions
-  * are met:
-  * 1. Redistributions of source code must retain the above copyright
-  *    notice, this list of conditions and the following disclaimer.
-  * 2. Redistributions in binary form must reproduce the above copyright
-  *    notice, this list of conditions and the following disclaimer in the
-  *    documentation and/or other materials provided with the distribution.
-  *
-  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
-
-#include <sys/cdefs.h>
-__RCSID("$NetBSD: getfsquota.c,v 1.4 2012/01/09 15:31:11 dholland Exp $");
-
-#include <quota.h>
-#include <quota/quota.h>
-
-#include "quotapvt.h"
-
-
-/*
- * "retrieve quotas with ufs semantics from vfs, for the given user id"
- */
-int
-getfsquota(const char *path, struct quotaval *qv, uid_t id,
-    const char *class)
-{
-       return __quota_getquota(path, qv, id, class);
-}
diff -r 3aa37b1a0aca -r 5cdabd746cc4 lib/libquota/getnfsquota.c
--- a/lib/libquota/getnfsquota.c        Wed Feb 01 17:48:10 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*     $NetBSD: getnfsquota.c,v 1.5 2012/01/09 15:31:11 dholland Exp $ */
-
-/*
- * Copyright (c) 1980, 1990, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Elz at The University of Melbourne.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1980, 1990, 1993\
- The Regents of the University of California.  All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)quota.c    8.4 (Berkeley) 4/28/95";
-#else
-__RCSID("$NetBSD: getnfsquota.c,v 1.5 2012/01/09 15:31:11 dholland Exp $");
-#endif
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/mount.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <quota.h>
-#include <quota/quota.h>
-
-#include "quotapvt.h"
-
-int
-getnfsquota(const char *mp, struct quotaval *qv,
-    uint32_t id, const char *class)
-{
-       struct statvfs *mounts;
-       size_t size;
-       int nummounts, i, ret;
-       int serrno;
-
-       /*
-        * For some reason getnfsquota was defined so that the mount
-        * information passed in is the f_mntfromname (containing the
-        * remote host and path) from statvfs. The only way to convert
-        * this back to something generally useful is to search the
-        * available mounts for something that matches. Sigh.
-        *
-        * Note that we can't use getmntinfo(3) as the caller probably
-        * is and another use would potentially interfere.
-        */
-
-       nummounts = getvfsstat(NULL, (size_t)0, MNT_NOWAIT);
-       if (nummounts < 0) {
-               return -1;
-       }
-       if (nummounts == 0) {
-               errno = ENOENT;
-               return -1;
-       }
-       size = nummounts * sizeof(mounts[0]);
-       mounts = malloc(size);
-       if (mounts == NULL) {
-               return -1;
-       }
-       nummounts = getvfsstat(mounts, size, MNT_NOWAIT);
-       if (nummounts < 0) {
-               serrno = errno;
-               free(mounts);
-               errno = serrno;
-               return -1;
-       }
-
-       /*
-        * Note: if the size goes up, someone added a new mount; it
-        * can't be the one we're looking for. Assume it will end up
-        * at the end of the list so we don't need to refetch the
-        * info, and reset nummounts to avoid chugging off the end
-        * of the array.
-        */
-       if (nummounts * sizeof(mounts[0]) > size) {
-               nummounts = size / sizeof(mounts[0]);
-       }
-
-       for (i=0; i<nummounts; i++) {
-               if (!strcmp(mounts[i].f_mntfromname, mp)) {
-                       ret = __quota_getquota(mounts[i].f_mntonname,
-                                              qv, id, class);
-                       serrno = errno;
-                       free(mounts);
-                       errno = serrno;
-                       return ret;
-               }
-       }
-       free(mounts);
-       errno = ENOENT;
-       return -1;
-}
diff -r 3aa37b1a0aca -r 5cdabd746cc4 lib/libquota/getufsquota.c
--- a/lib/libquota/getufsquota.c        Wed Feb 01 17:48:10 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*     $NetBSD: getufsquota.c,v 1.7 2012/01/30 19:19:55 dholland Exp $ */
-
-/*-
-  * Copyright (c) 2011 Manuel Bouyer
-  * All rights reserved.
-  *
-  * Redistribution and use in source and binary forms, with or without
-  * modification, are permitted provided that the following conditions
-  * are met:
-  * 1. Redistributions of source code must retain the above copyright
-  *    notice, this list of conditions and the following disclaimer.
-  * 2. Redistributions in binary form must reproduce the above copyright
-  *    notice, this list of conditions and the following disclaimer in the
-  *    documentation and/or other materials provided with the distribution.
-  *
-  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
-
-#include <sys/cdefs.h>
-__RCSID("$NetBSD: getufsquota.c,v 1.7 2012/01/30 19:19:55 dholland Exp $");
-
-#include <string.h>
-#include <errno.h>
-
-#include <quota/quota.h>
-#include <quota.h>
-
-#include "quotapvt.h"
-
-/* Some strings passed to getufsquota() and friends */
-#define QUOTADICT_CLASS_USER "user"
-#define QUOTADICT_CLASS_GROUP "group"
-
-/*
- * Return true if QV contains any actual information.
- *
- * XXX when qv_grace is not available it should be set to QUOTA_NOTIME,
- * not zero, but this is currently not always the case.
- */
-static int
-quotaval_nonempty(const struct quotaval *qv)
-{
-       if (qv->qv_hardlimit != QUOTA_NOLIMIT ||
-           qv->qv_softlimit != QUOTA_NOLIMIT ||
-           qv->qv_usage != 0 ||
-           qv->qv_expiretime != QUOTA_NOTIME ||
-           (qv->qv_grace != QUOTA_NOTIME && qv->qv_grace != 0)) {
-               return 1;
-       }
-       return 0;
-}
-
-/*
- * "retrieve quotas with ufs semantics from vfs, for the given user id"
- *
- * What this actually does is: for mount point MP, and id ID, which
- * can be either a uid or a gid depending on what string CLASS



Home | Main Index | Thread Index | Old Index