Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/netbsd32 Update compat_netbsd32 for new quotactl.
details: https://anonhg.NetBSD.org/src/rev/0499d4b49282
branches: trunk
changeset: 773381:0499d4b49282
user: dholland <dholland%NetBSD.org@localhost>
date: Wed Feb 01 05:40:00 2012 +0000
description:
Update compat_netbsd32 for new quotactl.
diffstat:
sys/compat/netbsd32/netbsd32.h | 65 +++++++++++++++-
sys/compat/netbsd32/netbsd32_netbsd.c | 117 +++++++++++++++++++++-------
sys/compat/netbsd32/netbsd32_syscall.h | 6 +-
sys/compat/netbsd32/netbsd32_syscallargs.h | 10 +--
sys/compat/netbsd32/netbsd32_syscalls.c | 6 +-
sys/compat/netbsd32/netbsd32_sysent.c | 8 +-
sys/compat/netbsd32/syscalls.master | 7 +-
7 files changed, 164 insertions(+), 55 deletions(-)
diffs (truncated from 362 to 300 lines):
diff -r 831ca5b73978 -r 0499d4b49282 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Wed Feb 01 05:39:28 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Wed Feb 01 05:40:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.89 2012/01/31 22:51:41 matt Exp $ */
+/* $NetBSD: netbsd32.h,v 1.90 2012/02/01 05:40:00 dholland Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -68,7 +68,7 @@
/* netbsd32_[u]int64 are machine dependent and defined below */
/*
- * machine depedant section; must define:
+ * machine dependant section; must define:
* netbsd32_pointer_t
* - 32-bit pointer type, normally uint32_t but can be int32_t
* for platforms which rely on sign-extension of pointers
@@ -268,6 +268,67 @@
/* from <sys/poll.h> */
typedef netbsd32_pointer_t netbsd32_pollfdp_t;
+/* from <sys/quotactl.h> */
+typedef netbsd32_pointer_t netbsd32_quotactlargsp_t;
+struct netbsd32_quotactlargs {
+ unsigned qc_op;
+ union {
+ struct {
+ netbsd32_pointer_t qc_ret;
+ } stat;
+ struct {
+ int qc_idtype;
+ netbsd32_pointer_t qc_info;
+ } idtypestat;
+ struct {
+ int qc_objtype;
+ netbsd32_pointer_t qc_info;
+ } objtypestat;
+ struct {
+ netbsd32_pointer_t qc_key;
+ netbsd32_pointer_t qc_ret;
+ } get;
+ struct {
+ netbsd32_pointer_t qc_key;
+ netbsd32_pointer_t qc_val;
+ } put;
+ struct {
+ netbsd32_pointer_t qc_key;
+ } delete;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ } cursoropen;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ } cursorclose;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ unsigned qc_idtype;
+ } cursorskipidtype;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ netbsd32_pointer_t qc_keys;
+ netbsd32_pointer_t qc_vals;
+ unsigned qc_maxnum;
+ netbsd32_pointer_t qc_ret;
+ } cursorget;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ netbsd32_pointer_t qc_ret;
+ } cursoratend;
+ struct {
+ netbsd32_pointer_t qc_cursor;
+ } cursorrewind;
+ struct {
+ int qc_idtype;
+ netbsd32_pointer_t qc_quotafile;
+ } quotaon;
+ struct {
+ int qc_idtype;
+ } quotaoff;
+ } u;
+};
+
/* from <sys/resource.h> */
typedef netbsd32_pointer_t netbsd32_rusage50p_t;
struct netbsd32_rusage50 {
diff -r 831ca5b73978 -r 0499d4b49282 sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c Wed Feb 01 05:39:28 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c Wed Feb 01 05:40:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.177 2012/01/31 22:53:56 matt Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.178 2012/02/01 05:40:00 dholland Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.177 2012/01/31 22:53:56 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.178 2012/02/01 05:40:00 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -68,6 +68,7 @@
#include <sys/filedesc.h>
#include <sys/namei.h>
#include <sys/dirent.h>
+#include <sys/quotactl.h>
#include <sys/kauth.h>
#include <sys/vfs_syscalls.h>
@@ -1185,39 +1186,97 @@
}
int
-netbsd32___quotactl50(struct lwp *l, const struct netbsd32___quotactl50_args *uap, register_t *retval)
+netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, register_t *retval)
{
/* {
syscallarg(const netbsd32_charp) path;
- syscallarg(netbsd32_voidp) v;
+ syscallarg(netbsd32_voidp) args;
} */
- struct plistref pref;
+ struct netbsd32_quotactlargs args32;
+ struct quotactl_args args;
int error;
- struct vnode *vp;
- struct mount *mp;
- prop_dictionary_t dict;
-
- error = namei_simple_user(SCARG_P32(uap, path),
- NSM_FOLLOW_TRYEMULROOT, &vp);
-
- if (error != 0)
- return (error);
- mp = vp->v_mount;
-
- error = netbsd32_copyin_plistref(SCARG(uap, pref), &pref);
- if (error)
+
+ error = copyin(SCARG_P32(uap, args), &args32, sizeof(args32));
+ if (error) {
return error;
- error = prop_dictionary_copyin(&pref, &dict);
- if (error)
- return error;
- error = vfs_quotactl(mp, dict);
- vrele(vp);
- if (!error)
- error = prop_dictionary_copyout(&pref, dict);
- if (!error)
- error = netbsd32_copyout_plistref(SCARG(uap, pref), &pref);
- prop_object_release(dict);
- return (error);
+ }
+
+ args.qc_op = args32.qc_op;
+ switch (args.qc_op) {
+ case QUOTACTL_STAT:
+ args.u.stat.qc_ret = NETBSD32PTR64(args32.u.stat.qc_ret);
+ break;
+ case QUOTACTL_IDTYPESTAT:
+ args.u.idtypestat.qc_idtype = args32.u.idtypestat.qc_idtype;
+ args.u.idtypestat.qc_info =
+ NETBSD32PTR64(args32.u.idtypestat.qc_info);
+ break;
+ case QUOTACTL_OBJTYPESTAT:
+ args.u.objtypestat.qc_objtype =
+ args32.u.objtypestat.qc_objtype;
+ args.u.objtypestat.qc_info =
+ NETBSD32PTR64(args32.u.objtypestat.qc_info);
+ break;
+ case QUOTACTL_GET:
+ args.u.get.qc_key = NETBSD32PTR64(args32.u.get.qc_key);
+ args.u.get.qc_ret = NETBSD32PTR64(args32.u.get.qc_ret);
+ break;
+ case QUOTACTL_PUT:
+ args.u.put.qc_key = NETBSD32PTR64(args32.u.put.qc_key);
+ args.u.put.qc_val = NETBSD32PTR64(args32.u.put.qc_val);
+ break;
+ case QUOTACTL_DELETE:
+ args.u.delete.qc_key = NETBSD32PTR64(args32.u.delete.qc_key);
+ break;
+ case QUOTACTL_CURSOROPEN:
+ args.u.cursoropen.qc_cursor =
+ NETBSD32PTR64(args32.u.cursoropen.qc_cursor);
+ break;
+ case QUOTACTL_CURSORCLOSE:
+ args.u.cursorclose.qc_cursor =
+ NETBSD32PTR64(args32.u.cursorclose.qc_cursor);
+ break;
+ case QUOTACTL_CURSORSKIPIDTYPE:
+ args.u.cursorskipidtype.qc_cursor =
+ NETBSD32PTR64(args32.u.cursorskipidtype.qc_cursor);
+ args.u.cursorskipidtype.qc_idtype =
+ args32.u.cursorskipidtype.qc_idtype;
+ break;
+ case QUOTACTL_CURSORGET:
+ args.u.cursorget.qc_cursor =
+ NETBSD32PTR64(args32.u.cursorget.qc_cursor);
+ args.u.cursorget.qc_keys =
+ NETBSD32PTR64(args32.u.cursorget.qc_keys);
+ args.u.cursorget.qc_vals =
+ NETBSD32PTR64(args32.u.cursorget.qc_vals);
+ args.u.cursorget.qc_maxnum =
+ args32.u.cursorget.qc_maxnum;
+ args.u.cursorget.qc_ret =
+ NETBSD32PTR64(args32.u.cursorget.qc_ret);
+ break;
+ case QUOTACTL_CURSORATEND:
+ args.u.cursoratend.qc_cursor =
+ NETBSD32PTR64(args32.u.cursoratend.qc_cursor);
+ args.u.cursoratend.qc_ret =
+ NETBSD32PTR64(args32.u.cursoratend.qc_ret);
+ break;
+ case QUOTACTL_CURSORREWIND:
+ args.u.cursorrewind.qc_cursor =
+ NETBSD32PTR64(args32.u.cursorrewind.qc_cursor);
+ break;
+ case QUOTACTL_QUOTAON:
+ args.u.quotaon.qc_idtype = args32.u.quotaon.qc_idtype;
+ args.u.quotaon.qc_quotafile =
+ NETBSD32PTR64(args32.u.quotaon.qc_quotafile);
+ break;
+ case QUOTACTL_QUOTAOFF:
+ args.u.quotaoff.qc_idtype = args32.u.quotaoff.qc_idtype;
+ break;
+ default:
+ return EINVAL;
+ }
+
+ return do_sys_quotactl(SCARG_P32(uap, path), &args);
}
int
diff -r 831ca5b73978 -r 0499d4b49282 sys/compat/netbsd32/netbsd32_syscall.h
--- a/sys/compat/netbsd32/netbsd32_syscall.h Wed Feb 01 05:39:28 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_syscall.h Wed Feb 01 05:40:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.97 2012/01/31 22:53:28 matt Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.98 2012/02/01 05:40:00 dholland Exp $ */
/*
* System call numbers.
@@ -1196,9 +1196,7 @@
/* syscall: "netbsd32___fhstat50" ret: "int" args: "const netbsd32_voidp" "netbsd32_size_t" "netbsd32_statp_t" */
#define NETBSD32_SYS_netbsd32___fhstat50 451
-/* syscall: "netbsd32___quotactl50" ret: "int" args: "const netbsd32_charp" "netbsd32_voidp" */
-#define NETBSD32_SYS_netbsd32___quotactl50 452
-
+ /* 452 is obsolete 5.99 quotactl */
/* syscall: "netbsd32_pipe2" ret: "int" args: "netbsd32_intp" "int" */
#define NETBSD32_SYS_netbsd32_pipe2 453
diff -r 831ca5b73978 -r 0499d4b49282 sys/compat/netbsd32/netbsd32_syscallargs.h
--- a/sys/compat/netbsd32/netbsd32_syscallargs.h Wed Feb 01 05:39:28 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_syscallargs.h Wed Feb 01 05:40:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.97 2012/01/31 22:53:28 matt Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.98 2012/02/01 05:40:00 dholland Exp $ */
/*
* System call argument lists.
@@ -2303,12 +2303,6 @@
};
check_syscall_args(netbsd32___fhstat50)
-struct netbsd32___quotactl50_args {
- syscallarg(const netbsd32_charp) path;
- syscallarg(netbsd32_voidp) pref;
-};
-check_syscall_args(netbsd32___quotactl50)
-
struct netbsd32_pipe2_args {
syscallarg(netbsd32_intp) fildes;
syscallarg(int) flags;
@@ -3235,8 +3229,6 @@
int netbsd32___fhstat50(struct lwp *, const struct netbsd32___fhstat50_args *, register_t *);
-int netbsd32___quotactl50(struct lwp *, const struct netbsd32___quotactl50_args *, register_t *);
-
int netbsd32_pipe2(struct lwp *, const struct netbsd32_pipe2_args *, register_t *);
int netbsd32_dup3(struct lwp *, const struct netbsd32_dup3_args *, register_t *);
diff -r 831ca5b73978 -r 0499d4b49282 sys/compat/netbsd32/netbsd32_syscalls.c
--- a/sys/compat/netbsd32/netbsd32_syscalls.c Wed Feb 01 05:39:28 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_syscalls.c Wed Feb 01 05:40:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.96 2012/01/31 22:53:28 matt Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.97 2012/02/01 05:40:00 dholland Exp $ */
/*
* System call names.
@@ -8,7 +8,7 @@
*/
Home |
Main Index |
Thread Index |
Old Index