Source-Changes-HG archive

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

[src/trunk]: src Change the syscall API for quotas over to the new non-propli...



details:   https://anonhg.NetBSD.org/src/rev/aeade072fe12
branches:  trunk
changeset: 773379:aeade072fe12
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Feb 01 05:34:38 2012 +0000

description:
Change the syscall API for quotas over to the new non-proplib one.

   - struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.

diffstat:

 common/include/quota/quotaprop.h             |     8 +-
 distrib/sets/lists/comp/mi                   |     3 +-
 external/gpl3/gdb/dist/sim/ppc/emul_netbsd.c |     3 +-
 lib/libc/sys/Makefile.inc                    |     4 +-
 lib/libc/sys/makelintstub                    |     3 +-
 lib/libquota/Makefile                        |     4 +-
 lib/libquota/quota_cursor.c                  |    64 +-
 lib/libquota/quota_delete.c                  |    10 +-
 lib/libquota/quota_get.c                     |    10 +-
 lib/libquota/quota_kernel.c                  |   342 +++++++
 lib/libquota/quota_oldfiles.c                |     6 +-
 lib/libquota/quota_open.c                    |    14 +-
 lib/libquota/quota_proplib.c                 |  1213 --------------------------
 lib/libquota/quota_put.c                     |    10 +-
 lib/libquota/quota_schema.c                  |    39 +-
 lib/libquota/quotapvt.h                      |    67 +-
 lib/librumphijack/hijack.c                   |    24 +-
 sys/compat/common/vfs_syscalls_50.c          |    34 +-
 sys/compat/netbsd32/syscalls.master          |     8 +-
 sys/kern/init_sysent.c                       |    12 +-
 sys/kern/syscalls.c                          |     8 +-
 sys/kern/syscalls.master                     |     8 +-
 sys/kern/vfs_quotactl.c                      |   992 +++------------------
 sys/kern/vfs_subr.c                          |     6 +-
 sys/kern/vfs_syscalls.c                      |   414 ++++++++-
 sys/miscfs/genfs/layer_extern.h              |     4 +-
 sys/miscfs/genfs/layer_vfsops.c              |     6 +-
 sys/rump/include/rump/rump_syscalls.h        |    21 +-
 sys/rump/librump/rumpkern/rump_syscalls.c    |    90 +-
 sys/sys/Makefile                             |     4 +-
 sys/sys/mount.h                              |    38 +-
 sys/sys/quotactl.h                           |    12 +-
 sys/sys/syscall.h                            |    11 +-
 sys/sys/syscallargs.h                        |    18 +-
 sys/ufs/ufs/ufs_extern.h                     |     6 +-
 sys/ufs/ufs/ufs_quota.c                      |    62 +-
 sys/ufs/ufs/ufs_vfsops.c                     |     6 +-
 usr.bin/ktruss/dump.c                        |     6 +-
 38 files changed, 1218 insertions(+), 2372 deletions(-)

diffs (truncated from 4834 to 300 lines):

diff -r 81025701a919 -r aeade072fe12 common/include/quota/quotaprop.h
--- a/common/include/quota/quotaprop.h  Wed Feb 01 05:25:57 2012 +0000
+++ b/common/include/quota/quotaprop.h  Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quotaprop.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
+/* $NetBSD: quotaprop.h,v 1.4 2012/02/01 05:34:38 dholland Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -84,10 +84,4 @@
 prop_dictionary_t quota64toprop(uid_t, int, uint64_t *[], const char *[], int,
     const char *[], int);
 
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-__BEGIN_DECLS
-int quotactl(const char *, struct plistref *) __RENAME(__quotactl50);
-__END_DECLS
-#endif
-
 #endif /* _QUOTA_QUOTAPROP_H_ */
diff -r 81025701a919 -r aeade072fe12 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Wed Feb 01 05:25:57 2012 +0000
+++ b/distrib/sets/lists/comp/mi        Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1728 2012/01/30 22:51:51 tls Exp $
+#      $NetBSD: mi,v 1.1729 2012/02/01 05:34:38 dholland Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2473,6 +2473,7 @@
 ./usr/include/sys/ptree.h                      comp-c-include
 ./usr/include/sys/queue.h                      comp-c-include
 ./usr/include/sys/quota.h                      comp-c-include
+./usr/include/sys/quotactl.h                   comp-c-include
 ./usr/include/sys/radioio.h                    comp-c-include
 ./usr/include/sys/ras.h                                comp-c-include
 ./usr/include/sys/rb.h                         comp-obsolete           obsolete
diff -r 81025701a919 -r aeade072fe12 external/gpl3/gdb/dist/sim/ppc/emul_netbsd.c
--- a/external/gpl3/gdb/dist/sim/ppc/emul_netbsd.c      Wed Feb 01 05:25:57 2012 +0000
+++ b/external/gpl3/gdb/dist/sim/ppc/emul_netbsd.c      Wed Feb 01 05:34:38 2012 +0000
@@ -1486,7 +1486,7 @@
   /* 449 */ { 0, "__wait450" },
   /* 450 */ { 0, "__mknod50" },
   /* 451 */ { 0, "__fhstat50" },
-  /* 452 */ { 0, "__quotactl50" },
+  { 0, }, /* 452 is obsolete 5.99 __quotactl50 */
   /* 453 */ { 0, "pipe2" },
   /* 454 */ { 0, "dup3" },
   /* 455 */ { 0, "kqueue1" },
@@ -1507,6 +1507,7 @@
   /* 470 */ { 0, "symlinkat" },
   /* 471 */ { 0, "unlinkat" },
   /* 472 */ { 0, "futimens" },
+  /* 473 */ { 0, "__quotactl" },
 };
 
 static char *(netbsd_error_names[]) = {
diff -r 81025701a919 -r aeade072fe12 lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Wed Feb 01 05:25:57 2012 +0000
+++ b/lib/libc/sys/Makefile.inc Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.209 2011/08/17 07:22:33 manu Exp $
+#      $NetBSD: Makefile.inc,v 1.210 2012/02/01 05:34:40 dholland Exp $
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -116,7 +116,7 @@
        paccept.S pathconf.S pipe2.S pmc_get_info.S pmc_control.S \
                __posix_chown.S __posix_fchown.S __posix_lchown.S \
                __posix_rename.S profil.S \
-       __quotactl50.S \
+       __quotactl.S \
        rasctl.S readlinkat.S reboot.S recvfrom.S recvmsg.S rename.S \
                renameat.S revoke.S rmdir.S \
        sa_register.S sa_stacks.S sa_enable.S sa_setconcurrency.S sa_yield.S \
diff -r 81025701a919 -r aeade072fe12 lib/libc/sys/makelintstub
--- a/lib/libc/sys/makelintstub Wed Feb 01 05:25:57 2012 +0000
+++ b/lib/libc/sys/makelintstub Wed Feb 01 05:34:38 2012 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-# $NetBSD: makelintstub,v 1.23 2008/08/05 02:08:13 lukem Exp $
+# $NetBSD: makelintstub,v 1.24 2012/02/01 05:34:40 dholland Exp $
 #
 # Copyright (c) 1996, 1997 Christopher G. Demetriou
 # All rights reserved.
@@ -79,6 +79,7 @@
        #include <sys/socket.h>
        #include <sys/event.h>
        #include <sys/uuid.h>
+       #include <sys/quotactl.h>
        #ifdef __STDC__
        #include <stdarg.h>
        #else
diff -r 81025701a919 -r aeade072fe12 lib/libquota/Makefile
--- a/lib/libquota/Makefile     Wed Feb 01 05:25:57 2012 +0000
+++ b/lib/libquota/Makefile     Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.6 2012/01/25 17:45:13 dholland Exp $
+#      $NetBSD: Makefile,v 1.7 2012/02/01 05:34:40 dholland Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/4/93
 
 .include <bsd.own.mk>
@@ -17,9 +17,9 @@
 SRCS+= quota_schema.c
 SRCS+= quota_get.c quota_put.c quota_delete.c
 SRCS+= quota_cursor.c
-SRCS+= quota_proplib.c
 SRCS+= quota_nfs.c
 SRCS+= quota_oldfiles.c
+SRCS+= quota_kernel.c
 
 MAN=   libquota.3
 MLINKS=        libquota.3 quota_close.3 \
diff -r 81025701a919 -r aeade072fe12 lib/libquota/quota_cursor.c
--- a/lib/libquota/quota_cursor.c       Wed Feb 01 05:25:57 2012 +0000
+++ b/lib/libquota/quota_cursor.c       Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quota_cursor.c,v 1.4 2012/01/25 17:43:37 dholland Exp $        */
+/*     $NetBSD: quota_cursor.c,v 1.5 2012/02/01 05:34:40 dholland Exp $        */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_cursor.c,v 1.4 2012/01/25 17:43:37 dholland Exp $");
+__RCSID("$NetBSD: quota_cursor.c,v 1.5 2012/02/01 05:34:40 dholland Exp $");
 
 #include <stdlib.h>
 #include <errno.h>
@@ -41,7 +41,7 @@
 quota_opencursor(struct quotahandle *qh)
 {
        struct quotacursor *qc;
-       int8_t version;
+       unsigned restrictions;
        int serrno;
 
        switch (qh->qh_mode) {
@@ -49,26 +49,25 @@
                errno = EOPNOTSUPP;
                return NULL;
 
-           case QUOTA_MODE_PROPLIB:
-               if (__quota_proplib_getversion(qh, &version)) {
-                       return NULL;
-               }
+           case QUOTA_MODE_OLDFILES:
+               restrictions = QUOTA_RESTRICT_NEEDSQUOTACHECK;
                break;
 
-           case QUOTA_MODE_OLDFILES:
-               version = 1;
+           case QUOTA_MODE_KERNEL:
+               restrictions = __quota_kernel_getrestrictions(qh);
                break;
 
            default:
                errno = EINVAL;
-               break;
+               return NULL;
        }
 
        /*
         * For the time being at least the version 1 kernel code
         * cannot do cursors.
         */
-       if (version == 1 && !qh->qh_oldfilesopen) {
+       if ((restrictions & QUOTA_RESTRICT_NEEDSQUOTACHECK) != 0 &&
+           !qh->qh_oldfilesopen) {
                if (__quota_oldfiles_initialize(qh)) {
                        return NULL;
                }
@@ -81,7 +80,7 @@
 
        qc->qc_qh = qh;
 
-       if (version == 1) {
+       if ((restrictions & QUOTA_RESTRICT_NEEDSQUOTACHECK) != 0) {
                qc->qc_type = QC_OLDFILES;
                qc->u.qc_oldfiles = __quota_oldfiles_cursor_create(qh);
                if (qc->u.qc_oldfiles == NULL) {
@@ -91,9 +90,9 @@
                        return NULL;
                }
        } else {
-               qc->qc_type = QC_PROPLIB;
-               qc->u.qc_proplib = __quota_proplib_cursor_create();
-               if (qc->u.qc_proplib == NULL) {
+               qc->qc_type = QC_KERNEL;
+               qc->u.qc_kernel = __quota_kernel_cursor_create(qh);
+               if (qc->u.qc_kernel == NULL) {
                        serrno = errno;
                        free(qc);
                        errno = serrno;
@@ -107,12 +106,12 @@
 quotacursor_close(struct quotacursor *qc)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               __quota_proplib_cursor_destroy(qc->u.qc_proplib);
-               break;
            case QC_OLDFILES:
                __quota_oldfiles_cursor_destroy(qc->u.qc_oldfiles);
                break;
+           case QC_KERNEL:
+               __quota_kernel_cursor_destroy(qc->qc_qh, qc->u.qc_kernel);
+               break;
        }
        free(qc);
 }
@@ -121,12 +120,13 @@
 quotacursor_skipidtype(struct quotacursor *qc, unsigned idtype)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               return __quota_proplib_cursor_skipidtype(qc->u.qc_proplib,
-                                                        idtype);
            case QC_OLDFILES:
                return __quota_oldfiles_cursor_skipidtype(qc->u.qc_oldfiles,
                                                          idtype);
+           case QC_KERNEL:
+               return __quota_kernel_cursor_skipidtype(qc->qc_qh,
+                                                       qc->u.qc_kernel,
+                                                       idtype);
        }
        errno = EINVAL;
        return -1;
@@ -137,13 +137,13 @@
                struct quotakey *qk_ret, struct quotaval *qv_ret)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               return __quota_proplib_cursor_get(qc->qc_qh, qc->u.qc_proplib,
-                                                 qk_ret, qv_ret);
            case QC_OLDFILES:
                return __quota_oldfiles_cursor_get(qc->qc_qh,
                                                   qc->u.qc_oldfiles,
                                                   qk_ret, qv_ret);
+           case QC_KERNEL:
+               return __quota_kernel_cursor_get(qc->qc_qh, qc->u.qc_kernel,
+                                                qk_ret, qv_ret);
        }
        errno = EINVAL;
        return -1;
@@ -155,13 +155,13 @@
                 unsigned maxnum)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               return __quota_proplib_cursor_getn(qc->qc_qh, qc->u.qc_proplib,
-                                                  keys, vals, maxnum);
            case QC_OLDFILES:
                return __quota_oldfiles_cursor_getn(qc->qc_qh,
                                                    qc->u.qc_oldfiles,
                                                    keys, vals, maxnum);
+           case QC_KERNEL:
+               return __quota_kernel_cursor_getn(qc->qc_qh, qc->u.qc_kernel,
+                                                  keys, vals, maxnum);
        }
        errno = EINVAL;
        return -1;
@@ -171,11 +171,11 @@
 quotacursor_atend(struct quotacursor *qc)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               return __quota_proplib_cursor_atend(qc->qc_qh,
-                                                   qc->u.qc_proplib);
            case QC_OLDFILES:
                return __quota_oldfiles_cursor_atend(qc->u.qc_oldfiles);
+
+           case QC_KERNEL:
+               return __quota_kernel_cursor_atend(qc->qc_qh, qc->u.qc_kernel);
        }
        errno = EINVAL;
        return -1;
@@ -185,10 +185,10 @@
 quotacursor_rewind(struct quotacursor *qc)
 {
        switch (qc->qc_type) {
-           case QC_PROPLIB:
-               return __quota_proplib_cursor_rewind(qc->u.qc_proplib);
            case QC_OLDFILES:
                return __quota_oldfiles_cursor_rewind(qc->u.qc_oldfiles);
+           case QC_KERNEL:
+               return __quota_kernel_cursor_rewind(qc->qc_qh,qc->u.qc_kernel);
        }
        errno = EINVAL;
        return -1;
diff -r 81025701a919 -r aeade072fe12 lib/libquota/quota_delete.c
--- a/lib/libquota/quota_delete.c       Wed Feb 01 05:25:57 2012 +0000
+++ b/lib/libquota/quota_delete.c       Wed Feb 01 05:34:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quota_delete.c,v 1.3 2012/01/25 17:43:37 dholland Exp $        */
+/*     $NetBSD: quota_delete.c,v 1.4 2012/02/01 05:34:40 dholland Exp $        */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.



Home | Main Index | Thread Index | Old Index