Sun Jan 29 06:29:05 2012 UTC ()
Add vfs_quotactl() in between the syscall and VFS_QUOTACTL. Call it
from the COMPAT_50 code as well as the current sys_quotactl instead
of going directly to VFS_QUOTACTL. Doesn't actually do anything yet.


(dholland)
diff -r1.11 -r1.12 src/sys/compat/common/vfs_syscalls_50.c
diff -r1.175 -r1.176 src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -r1.1 -r1.2 src/sys/kern/vfs_quotactl.c
diff -r1.442 -r1.443 src/sys/kern/vfs_syscalls.c
diff -r1.201 -r1.202 src/sys/sys/mount.h

cvs diff -r1.11 -r1.12 src/sys/compat/common/vfs_syscalls_50.c (expand / switch to unified diff)

--- src/sys/compat/common/vfs_syscalls_50.c 2012/01/29 06:23:20 1.11
+++ src/sys/compat/common/vfs_syscalls_50.c 2012/01/29 06:29:04 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_syscalls_50.c,v 1.11 2012/01/29 06:23:20 dholland Exp $ */ 1/* $NetBSD: vfs_syscalls_50.c,v 1.12 2012/01/29 06:29:04 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas. 8 * by Christos Zoulas.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE. 36 * POSSIBILITY OF SUCH DAMAGE.
37 */ 37 */
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.11 2012/01/29 06:23:20 dholland Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.12 2012/01/29 06:29:04 dholland Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/namei.h> 43#include <sys/namei.h>
44#include <sys/filedesc.h> 44#include <sys/filedesc.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/file.h> 46#include <sys/file.h>
47#include <sys/stat.h> 47#include <sys/stat.h>
48#include <sys/socketvar.h> 48#include <sys/socketvar.h>
49#include <sys/vnode.h> 49#include <sys/vnode.h>
50#include <sys/mount.h> 50#include <sys/mount.h>
51#include <sys/proc.h> 51#include <sys/proc.h>
52#include <sys/uio.h> 52#include <sys/uio.h>
@@ -381,27 +381,27 @@ compat_50_sys_quotactl(struct lwp *l, co @@ -381,27 +381,27 @@ compat_50_sys_quotactl(struct lwp *l, co
381 datas)) 381 datas))
382 goto out_cmds; 382 goto out_cmds;
383 goto do_quotaonoff; 383 goto do_quotaonoff;
384 384
385 case Q_QUOTAOFF: 385 case Q_QUOTAOFF:
386 error = ENOMEM; 386 error = ENOMEM;
387 if (!quota_prop_add_command(cmds, "quotaoff", 387 if (!quota_prop_add_command(cmds, "quotaoff",
388 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)], 388 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
389 datas)) 389 datas))
390 goto out_cmds; 390 goto out_cmds;
391do_quotaonoff: 391do_quotaonoff:
392 if (!prop_dictionary_set_and_rel(dict, "commands", cmds)) 392 if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
393 goto out_dict; 393 goto out_dict;
394 error = VFS_QUOTACTL(mp, dict); 394 error = vfs_quotactl(mp, dict);
395 if (error) 395 if (error)
396 goto out_dict; 396 goto out_dict;
397 if ((error = quota_get_cmds(dict, &cmds)) != 0) 397 if ((error = quota_get_cmds(dict, &cmds)) != 0)
398 goto out_dict; 398 goto out_dict;
399 cmd = prop_array_get(cmds, 0); 399 cmd = prop_array_get(cmds, 0);
400 if (cmd == NULL) { 400 if (cmd == NULL) {
401 error = EINVAL; 401 error = EINVAL;
402 goto out_dict; 402 goto out_dict;
403 } 403 }
404 if (!prop_dictionary_get_int8(cmd, "return", &error8)) { 404 if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
405 error = EINVAL; 405 error = EINVAL;
406 goto out_dict; 406 goto out_dict;
407 } 407 }
@@ -413,27 +413,27 @@ do_quotaonoff: @@ -413,27 +413,27 @@ do_quotaonoff:
413 data = prop_dictionary_create(); 413 data = prop_dictionary_create();
414 if (data == NULL) 414 if (data == NULL)
415 goto out_datas; 415 goto out_datas;
416 if (!prop_dictionary_set_uint32(data, "id", SCARG(uap, uid))) 416 if (!prop_dictionary_set_uint32(data, "id", SCARG(uap, uid)))
417 goto out_data; 417 goto out_data;
418 if (!prop_array_add_and_rel(datas, data)) 418 if (!prop_array_add_and_rel(datas, data))
419 goto out_datas; 419 goto out_datas;
420 if (!quota_prop_add_command(cmds, "get", 420 if (!quota_prop_add_command(cmds, "get",
421 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)], 421 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
422 datas)) 422 datas))
423 goto out_cmds; 423 goto out_cmds;
424 if (!prop_dictionary_set_and_rel(dict, "commands", cmds)) 424 if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
425 goto out_dict; 425 goto out_dict;
426 error = VFS_QUOTACTL(mp, dict); 426 error = vfs_quotactl(mp, dict);
427 if (error) 427 if (error)
428 goto out_dict; 428 goto out_dict;
429 if ((error = quota_get_cmds(dict, &cmds)) != 0) 429 if ((error = quota_get_cmds(dict, &cmds)) != 0)
430 goto out_dict; 430 goto out_dict;
431 cmd = prop_array_get(cmds, 0); 431 cmd = prop_array_get(cmds, 0);
432 if (cmd == NULL) { 432 if (cmd == NULL) {
433 error = EINVAL; 433 error = EINVAL;
434 goto out_dict; 434 goto out_dict;
435 } 435 }
436 if (!prop_dictionary_get_int8(cmd, "return", &error8)) { 436 if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
437 error = EINVAL; 437 error = EINVAL;
438 goto out_dict; 438 goto out_dict;
439 } 439 }
@@ -469,27 +469,27 @@ do_quotaonoff: @@ -469,27 +469,27 @@ do_quotaonoff:
469 data = quota64toprop(SCARG(uap, uid), 0, values, 469 data = quota64toprop(SCARG(uap, uid), 0, values,
470 ufs_quota_entry_names, UFS_QUOTA_NENTRIES, 470 ufs_quota_entry_names, UFS_QUOTA_NENTRIES,
471 ufs_quota_limit_names, QUOTA_NLIMITS); 471 ufs_quota_limit_names, QUOTA_NLIMITS);
472 if (data == NULL) 472 if (data == NULL)
473 goto out_data; 473 goto out_data;
474 if (!prop_array_add_and_rel(datas, data)) 474 if (!prop_array_add_and_rel(datas, data))
475 goto out_datas; 475 goto out_datas;
476 if (!quota_prop_add_command(cmds, "set", 476 if (!quota_prop_add_command(cmds, "set",
477 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)], 477 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
478 datas)) 478 datas))
479 goto out_cmds; 479 goto out_cmds;
480 if (!prop_dictionary_set_and_rel(dict, "commands", cmds)) 480 if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
481 goto out_dict; 481 goto out_dict;
482 error = VFS_QUOTACTL(mp, dict); 482 error = vfs_quotactl(mp, dict);
483 if (error) 483 if (error)
484 goto out_dict; 484 goto out_dict;
485 if ((error = quota_get_cmds(dict, &cmds)) != 0) 485 if ((error = quota_get_cmds(dict, &cmds)) != 0)
486 goto out_dict; 486 goto out_dict;
487 cmd = prop_array_get(cmds, 0); 487 cmd = prop_array_get(cmds, 0);
488 if (cmd == NULL) { 488 if (cmd == NULL) {
489 error = EINVAL; 489 error = EINVAL;
490 goto out_dict; 490 goto out_dict;
491 } 491 }
492 if (!prop_dictionary_get_int8(cmd, "return", &error8)) { 492 if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
493 error = EINVAL; 493 error = EINVAL;
494 goto out_dict; 494 goto out_dict;
495 } 495 }
@@ -498,27 +498,27 @@ do_quotaonoff: @@ -498,27 +498,27 @@ do_quotaonoff:
498  498
499 case Q_SYNC: 499 case Q_SYNC:
500 /* 500 /*
501 * not supported but used only to see if quota is supported, 501 * not supported but used only to see if quota is supported,
502 * emulate with a "get version" 502 * emulate with a "get version"
503 */ 503 */
504 error = ENOMEM; 504 error = ENOMEM;
505 if (!quota_prop_add_command(cmds, "get version", 505 if (!quota_prop_add_command(cmds, "get version",
506 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)], 506 ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
507 datas)) 507 datas))
508 goto out_cmds; 508 goto out_cmds;
509 if (!prop_dictionary_set_and_rel(dict, "commands", cmds)) 509 if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
510 goto out_dict; 510 goto out_dict;
511 error = VFS_QUOTACTL(mp, dict); 511 error = vfs_quotactl(mp, dict);
512 if (error) 512 if (error)
513 goto out_dict; 513 goto out_dict;
514 if ((error = quota_get_cmds(dict, &cmds)) != 0) 514 if ((error = quota_get_cmds(dict, &cmds)) != 0)
515 goto out_dict; 515 goto out_dict;
516 cmd = prop_array_get(cmds, 0); 516 cmd = prop_array_get(cmds, 0);
517 if (cmd == NULL) { 517 if (cmd == NULL) {
518 error = EINVAL; 518 error = EINVAL;
519 goto out_dict; 519 goto out_dict;
520 } 520 }
521 if (!prop_dictionary_get_int8(cmd, "return", &error8)) { 521 if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
522 error = EINVAL; 522 error = EINVAL;
523 goto out_dict; 523 goto out_dict;
524 } 524 }

cvs diff -r1.175 -r1.176 src/sys/compat/netbsd32/netbsd32_netbsd.c (expand / switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32_netbsd.c 2011/11/15 14:13:17 1.175
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c 2012/01/29 06:29:04 1.176
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: netbsd32_netbsd.c,v 1.175 2011/11/15 14:13:17 njoly Exp $ */ 1/* $NetBSD: netbsd32_netbsd.c,v 1.176 2012/01/29 06:29:04 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green 4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.175 2011/11/15 14:13:17 njoly Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.176 2012/01/29 06:29:04 dholland Exp $");
31 31
32#if defined(_KERNEL_OPT) 32#if defined(_KERNEL_OPT)
33#include "opt_ddb.h" 33#include "opt_ddb.h"
34#include "opt_ntp.h" 34#include "opt_ntp.h"
35#include "opt_compat_netbsd.h" 35#include "opt_compat_netbsd.h"
36#include "opt_compat_43.h" 36#include "opt_compat_43.h"
37#include "opt_sysv.h" 37#include "opt_sysv.h"
38#include "opt_syscall_debug.h" 38#include "opt_syscall_debug.h"
39#include "opt_sa.h" 39#include "opt_sa.h"
40#endif 40#endif
41 41
42/* 42/*
43 * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux, 43 * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
@@ -1200,27 +1200,27 @@ netbsd32___quotactl50(struct lwp *l, con @@ -1200,27 +1200,27 @@ netbsd32___quotactl50(struct lwp *l, con
1200 error = namei_simple_user(SCARG_P32(uap, path), 1200 error = namei_simple_user(SCARG_P32(uap, path),
1201 NSM_FOLLOW_TRYEMULROOT, &vp); 1201 NSM_FOLLOW_TRYEMULROOT, &vp);
1202 1202
1203 if (error != 0) 1203 if (error != 0)
1204 return (error); 1204 return (error);
1205 mp = vp->v_mount; 1205 mp = vp->v_mount;
1206 1206
1207 error = netbsd32_copyin_plistref(SCARG(uap, pref), &pref); 1207 error = netbsd32_copyin_plistref(SCARG(uap, pref), &pref);
1208 if (error) 1208 if (error)
1209 return error; 1209 return error;
1210 error = prop_dictionary_copyin(&pref, &dict); 1210 error = prop_dictionary_copyin(&pref, &dict);
1211 if (error) 1211 if (error)
1212 return error; 1212 return error;
1213 error = VFS_QUOTACTL(mp, dict); 1213 error = vfs_quotactl(mp, dict);
1214 vrele(vp); 1214 vrele(vp);
1215 if (!error) 1215 if (!error)
1216 error = prop_dictionary_copyout(&pref, dict); 1216 error = prop_dictionary_copyout(&pref, dict);
1217 if (!error) 1217 if (!error)
1218 error = netbsd32_copyout_plistref(SCARG(uap, pref), &pref); 1218 error = netbsd32_copyout_plistref(SCARG(uap, pref), &pref);
1219 prop_object_release(dict); 1219 prop_object_release(dict);
1220 return (error); 1220 return (error);
1221} 1221}
1222 1222
1223int 1223int
1224netbsd32___getfh30(struct lwp *l, const struct netbsd32___getfh30_args *uap, register_t *retval) 1224netbsd32___getfh30(struct lwp *l, const struct netbsd32___getfh30_args *uap, register_t *retval)
1225{ 1225{
1226 /* { 1226 /* {

cvs diff -r1.1 -r1.2 src/sys/kern/vfs_quotactl.c (expand / switch to unified diff)

--- src/sys/kern/vfs_quotactl.c 2012/01/29 06:26:55 1.1
+++ src/sys/kern/vfs_quotactl.c 2012/01/29 06:29:05 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_quotactl.c,v 1.1 2012/01/29 06:26:55 dholland Exp $ */ 1/* $NetBSD: vfs_quotactl.c,v 1.2 2012/01/29 06:29:05 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1986, 1990, 1993, 1995 4 * Copyright (c) 1982, 1986, 1990, 1993, 1995
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Robert Elz at The University of Melbourne. 8 * Robert Elz at The University of Melbourne.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -26,15 +26,22 @@ @@ -26,15 +26,22 @@
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95 34 * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95
35 * From ufs_quota.c,v 1.70 2011/03/24 17:05:46 bouyer Exp 35 * From ufs_quota.c,v 1.70 2011/03/24 17:05:46 bouyer Exp
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.1 2012/01/29 06:26:55 dholland Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.2 2012/01/29 06:29:05 dholland Exp $");
40 40
 41#include <sys/mount.h>
 42
 43int
 44vfs_quotactl(struct mount *mp, prop_dictionary_t dict)
 45{
 46 return VFS_QUOTACTL(mp, dict);
 47}

cvs diff -r1.442 -r1.443 src/sys/kern/vfs_syscalls.c (expand / switch to unified diff)

--- src/sys/kern/vfs_syscalls.c 2011/12/02 12:30:14 1.442
+++ src/sys/kern/vfs_syscalls.c 2012/01/29 06:29:05 1.443
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_syscalls.c,v 1.442 2011/12/02 12:30:14 yamt Exp $ */ 1/* $NetBSD: vfs_syscalls.c,v 1.443 2012/01/29 06:29:05 dholland Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE. 63 * SUCH DAMAGE.
64 * 64 *
65 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95 65 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95
66 */ 66 */
67 67
68/* 68/*
69 * Virtual File System System Calls 69 * Virtual File System System Calls
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.442 2011/12/02 12:30:14 yamt Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.443 2012/01/29 06:29:05 dholland Exp $");
74 74
75#ifdef _KERNEL_OPT 75#ifdef _KERNEL_OPT
76#include "opt_fileassoc.h" 76#include "opt_fileassoc.h"
77#include "veriexec.h" 77#include "veriexec.h"
78#endif 78#endif
79 79
80#include <sys/param.h> 80#include <sys/param.h>
81#include <sys/systm.h> 81#include <sys/systm.h>
82#include <sys/namei.h> 82#include <sys/namei.h>
83#include <sys/filedesc.h> 83#include <sys/filedesc.h>
84#include <sys/kernel.h> 84#include <sys/kernel.h>
85#include <sys/file.h> 85#include <sys/file.h>
86#include <sys/fcntl.h> 86#include <sys/fcntl.h>
@@ -616,27 +616,27 @@ sys___quotactl50(struct lwp *l, const st @@ -616,27 +616,27 @@ sys___quotactl50(struct lwp *l, const st
616 struct plistref pref; 616 struct plistref pref;
617 617
618 error = namei_simple_user(SCARG(uap, path), 618 error = namei_simple_user(SCARG(uap, path),
619 NSM_FOLLOW_TRYEMULROOT, &vp); 619 NSM_FOLLOW_TRYEMULROOT, &vp);
620 if (error != 0) 620 if (error != 0)
621 return (error); 621 return (error);
622 mp = vp->v_mount; 622 mp = vp->v_mount;
623 error = copyin(SCARG(uap, pref), &pref, sizeof(pref)); 623 error = copyin(SCARG(uap, pref), &pref, sizeof(pref));
624 if (error) 624 if (error)
625 return error; 625 return error;
626 error = prop_dictionary_copyin(&pref, &dict); 626 error = prop_dictionary_copyin(&pref, &dict);
627 if (error) 627 if (error)
628 return error; 628 return error;
629 error = VFS_QUOTACTL(mp, dict); 629 error = vfs_quotactl(mp, dict);
630 vrele(vp); 630 vrele(vp);
631 if (!error) 631 if (!error)
632 error = prop_dictionary_copyout(&pref, dict); 632 error = prop_dictionary_copyout(&pref, dict);
633 if (!error) 633 if (!error)
634 error = copyout(&pref, SCARG(uap, pref), sizeof(pref)); 634 error = copyout(&pref, SCARG(uap, pref), sizeof(pref));
635 prop_object_release(dict); 635 prop_object_release(dict);
636 return (error); 636 return (error);
637} 637}
638 638
639int 639int
640dostatvfs(struct mount *mp, struct statvfs *sp, struct lwp *l, int flags, 640dostatvfs(struct mount *mp, struct statvfs *sp, struct lwp *l, int flags,
641 int root) 641 int root)
642{ 642{

cvs diff -r1.201 -r1.202 src/sys/sys/mount.h (expand / switch to unified diff)

--- src/sys/sys/mount.h 2011/10/12 23:04:22 1.201
+++ src/sys/sys/mount.h 2012/01/29 06:29:04 1.202
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mount.h,v 1.201 2011/10/12 23:04:22 dholland Exp $ */ 1/* $NetBSD: mount.h,v 1.202 2012/01/29 06:29:04 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1989, 1991, 1993 4 * Copyright (c) 1989, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -397,26 +397,27 @@ int vfs_busy(struct mount *, struct mou @@ -397,26 +397,27 @@ int vfs_busy(struct mount *, struct mou
397int vfs_rootmountalloc(const char *, const char *, struct mount **); 397int vfs_rootmountalloc(const char *, const char *, struct mount **);
398void vfs_unbusy(struct mount *, bool, struct mount **); 398void vfs_unbusy(struct mount *, bool, struct mount **);
399int vfs_attach(struct vfsops *); 399int vfs_attach(struct vfsops *);
400int vfs_detach(struct vfsops *); 400int vfs_detach(struct vfsops *);
401void vfs_reinit(void); 401void vfs_reinit(void);
402struct vfsops *vfs_getopsbyname(const char *); 402struct vfsops *vfs_getopsbyname(const char *);
403void vfs_delref(struct vfsops *); 403void vfs_delref(struct vfsops *);
404void vfs_destroy(struct mount *); 404void vfs_destroy(struct mount *);
405void vfs_scrubvnlist(struct mount *); 405void vfs_scrubvnlist(struct mount *);
406struct mount *vfs_mountalloc(struct vfsops *, struct vnode *); 406struct mount *vfs_mountalloc(struct vfsops *, struct vnode *);
407int vfs_stdextattrctl(struct mount *, int, struct vnode *, 407int vfs_stdextattrctl(struct mount *, int, struct vnode *,
408 int, const char *); 408 int, const char *);
409void vfs_insmntque(struct vnode *, struct mount *); 409void vfs_insmntque(struct vnode *, struct mount *);
 410int vfs_quotactl(struct mount *, prop_dictionary_t);
410 411
411extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ 412extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
412extern struct vfsops *vfssw[]; /* filesystem type table */ 413extern struct vfsops *vfssw[]; /* filesystem type table */
413extern int nvfssw; 414extern int nvfssw;
414extern kmutex_t mountlist_lock; 415extern kmutex_t mountlist_lock;
415extern kmutex_t vfs_list_lock; 416extern kmutex_t vfs_list_lock;
416 417
417void vfs_mount_sysinit(void); 418void vfs_mount_sysinit(void);
418long makefstype(const char *); 419long makefstype(const char *);
419int mount_domount(struct lwp *, struct vnode **, struct vfsops *, 420int mount_domount(struct lwp *, struct vnode **, struct vfsops *,
420 const char *, int, void *, size_t *); 421 const char *, int, void *, size_t *);
421int dounmount(struct mount *, int, struct lwp *); 422int dounmount(struct mount *, int, struct lwp *);
422int do_sys_mount(struct lwp *, struct vfsops *, const char *, const char *, 423int do_sys_mount(struct lwp *, struct vfsops *, const char *, const char *,