Revert the following changes:

src/sys/sys/quotactl.h 1.37
   src/sys/compat/netbsd32/netbsd32.h 1.101
   src/sys/compat/netbsd32/netbsd32_netbsd.c 1.188, 1.189
   src/sys/kern/vfs_quotactl.c 1.39
   src/sys/kern/vfs_syscalls.c 1.483
   src/sys/ufs/lfs/ulfs_quota.c 1.11
   src/sys/ufs/ufs/ufs_quota.c 1.116
   src/lib/libquota/quota_kernel.c 1.5

and do them correctly.

If you're going to change the name of something, you need to change
the name of *all* the things with the same name, not just a handful,
and you should change it to something similar so it still matches the
rest of the system rather than just picking an arbitrarily different
name.

Hi, Joerg.

To wit, rename the quotactl "delete" operation to "del", because
"delete" is a reserved word in C++ and for some reason Joerg wants to
run internal interfaces used only by C code through his C++ compiler.
Do not rename it to "remove" instead, because this doesn't match
libquota or the rest of the usage throughout the system; and rename
all the related identifiers, not just the ones that blew the mind of
Joerg's C++ compiler.

Because this is not a user-facing API (the only userland consumer
sys/quotactl.h is libquota) it is sort of ok to make arbitrary
source-incompatible changes; however, by the same token it's completely
unnecessary. If it *were* a user-facing API that someone might have a
semi-rational reason to want to run a C++ compiler on, it would be
incorrect to change it at this point.
This commit is contained in:
dholland 2014-06-28 22:27:50 +00:00
parent c53acaa3d4
commit 01e782f371
13 changed files with 54 additions and 54 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: quota_kernel.c,v 1.5 2014/06/12 21:39:45 joerg Exp $ */
/* $NetBSD: quota_kernel.c,v 1.6 2014/06/28 22:27:50 dholland Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: quota_kernel.c,v 1.5 2014/06/12 21:39:45 joerg Exp $");
__RCSID("$NetBSD: quota_kernel.c,v 1.6 2014/06/28 22:27:50 dholland Exp $");
#include <stdlib.h>
#include <err.h>
@ -220,8 +220,8 @@ __quota_kernel_delete(struct quotahandle *qh, const struct quotakey *qk)
{
struct quotactl_args args;
args.qc_op = QUOTACTL_DELETE;
args.u.remove.qc_key = qk;
args.qc_op = QUOTACTL_DEL;
args.u.del.qc_key = qk;
return __quotactl(qh->qh_mountpoint, &args);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32.h,v 1.101 2014/06/13 10:37:02 joerg Exp $ */
/* $NetBSD: netbsd32.h,v 1.102 2014/06/28 22:27:50 dholland Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@ -300,7 +300,7 @@ struct netbsd32_quotactlargs {
} put;
struct {
netbsd32_pointer_t qc_key;
} remove;
} del;
struct {
netbsd32_pointer_t qc_cursor;
} cursoropen;

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.191 2014/06/28 11:39:15 maxv Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.192 2014/06/28 22:27:50 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.191 2014/06/28 11:39:15 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.192 2014/06/28 22:27:50 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -1235,8 +1235,8 @@ netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, r
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.remove.qc_key = NETBSD32PTR64(args32.u.remove.qc_key);
case QUOTACTL_DEL:
args.u.del.qc_key = NETBSD32PTR64(args32.u.del.qc_key);
break;
case QUOTACTL_CURSOROPEN:
args.u.cursoropen.qc_cursor =

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_quotactl.c,v 1.39 2014/06/12 21:39:45 joerg Exp $ */
/* $NetBSD: vfs_quotactl.c,v 1.40 2014/06/28 22:27:50 dholland Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.39 2014/06/12 21:39:45 joerg Exp $$");
__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.40 2014/06/28 22:27:50 dholland Exp $$");
#include <sys/mount.h>
#include <sys/quotactl.h>
@ -93,12 +93,12 @@ vfs_quotactl_put(struct mount *mp, const struct quotakey *key,
}
int
vfs_quotactl_delete(struct mount *mp, const struct quotakey *key)
vfs_quotactl_del(struct mount *mp, const struct quotakey *key)
{
struct quotactl_args args;
args.qc_op = QUOTACTL_DELETE;
args.u.remove.qc_key = key;
args.qc_op = QUOTACTL_DEL;
args.u.del.qc_key = key;
return VFS_QUOTACTL(mp, &args);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls.c,v 1.485 2014/06/26 01:46:03 christos Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.486 2014/06/28 22:27:50 dholland Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.485 2014/06/26 01:46:03 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.486 2014/06/28 22:27:50 dholland Exp $");
#ifdef _KERNEL_OPT
#include "opt_fileassoc.h"
@ -764,7 +764,7 @@ do_sys_quotactl_put(struct mount *mp, const struct quotakey *key_u,
}
static int
do_sys_quotactl_delete(struct mount *mp, const struct quotakey *key_u)
do_sys_quotactl_del(struct mount *mp, const struct quotakey *key_u)
{
struct quotakey key_k;
int error;
@ -774,7 +774,7 @@ do_sys_quotactl_delete(struct mount *mp, const struct quotakey *key_u)
return error;
}
return vfs_quotactl_delete(mp, &key_k);
return vfs_quotactl_del(mp, &key_k);
}
static int
@ -1003,8 +1003,8 @@ do_sys_quotactl(const char *path_u, const struct quotactl_args *args)
args->u.put.qc_key,
args->u.put.qc_val);
break;
case QUOTACTL_DELETE:
error = do_sys_quotactl_delete(mp, args->u.remove.qc_key);
case QUOTACTL_DEL:
error = do_sys_quotactl_del(mp, args->u.del.qc_key);
break;
case QUOTACTL_CURSOROPEN:
error = do_sys_quotactl_cursoropen(mp,

View File

@ -1,4 +1,4 @@
/* $NetBSD: mount.h,v 1.214 2014/05/24 16:34:03 christos Exp $ */
/* $NetBSD: mount.h,v 1.215 2014/06/28 22:27:50 dholland Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@ -427,7 +427,7 @@ int vfs_quotactl_get(struct mount *, const struct quotakey *,
struct quotaval *);
int vfs_quotactl_put(struct mount *, const struct quotakey *,
const struct quotaval *);
int vfs_quotactl_delete(struct mount *, const struct quotakey *);
int vfs_quotactl_del(struct mount *, const struct quotakey *);
int vfs_quotactl_cursoropen(struct mount *, struct quotakcursor *);
int vfs_quotactl_cursorclose(struct mount *, struct quotakcursor *);
int vfs_quotactl_cursorskipidtype(struct mount *, struct quotakcursor *,

View File

@ -1,4 +1,4 @@
/* $NetBSD: quotactl.h,v 1.37 2014/06/12 21:39:45 joerg Exp $ */
/* $NetBSD: quotactl.h,v 1.38 2014/06/28 22:27:50 dholland Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -83,7 +83,7 @@ struct quotakcursor {
#define QUOTACTL_OBJTYPESTAT 2
#define QUOTACTL_GET 3
#define QUOTACTL_PUT 4
#define QUOTACTL_DELETE 5
#define QUOTACTL_DEL 5
#define QUOTACTL_CURSOROPEN 6
#define QUOTACTL_CURSORCLOSE 7
#define QUOTACTL_CURSORSKIPIDTYPE 8
@ -118,7 +118,7 @@ struct quotactl_args {
} put;
struct {
const struct quotakey *qc_key;
} remove;
} del;
struct {
struct quotakcursor *qc_cursor;
} cursoropen;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_quota.c,v 1.11 2014/06/12 21:39:45 joerg Exp $ */
/* $NetBSD: ulfs_quota.c,v 1.12 2014/06/28 22:27:51 dholland Exp $ */
/* from NetBSD: ufs_quota.c,v 1.115 2013/11/16 17:04:53 dholland Exp */
/*
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota.c,v 1.11 2014/06/12 21:39:45 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota.c,v 1.12 2014/06/28 22:27:51 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -84,7 +84,7 @@ static int quota_handle_cmd_put(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_cursorget(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_delete(struct mount *, struct lwp *,
static int quota_handle_cmd_del(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_quotaon(struct mount *, struct lwp *,
struct quotactl_args *args);
@ -199,8 +199,8 @@ lfsquota_handle_cmd(struct mount *mp, struct lwp *l,
case QUOTACTL_CURSORGET:
error = quota_handle_cmd_cursorget(mp, l, args);
break;
case QUOTACTL_DELETE:
error = quota_handle_cmd_delete(mp, l, args);
case QUOTACTL_DEL:
error = quota_handle_cmd_del(mp, l, args);
break;
case QUOTACTL_CURSOROPEN:
error = quota_handle_cmd_cursoropen(mp, l, args);
@ -433,7 +433,7 @@ quota_handle_cmd_put(struct mount *mp, struct lwp *l,
}
static int
quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
quota_handle_cmd_del(struct mount *mp, struct lwp *l,
struct quotactl_args *args)
{
struct ulfsmount *ump = VFSTOULFS(mp);
@ -442,8 +442,8 @@ quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
id_t kauth_id;
int error;
KASSERT(args->qc_op == QUOTACTL_DELETE);
qk = args->u.remove.qc_key;
KASSERT(args->qc_op == QUOTACTL_DEL);
qk = args->u.del.qc_key;
kauth_id = qk->qk_id;
if (kauth_id == QUOTA_DEFAULTID) {
@ -462,7 +462,7 @@ quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
goto err;
#ifdef LFS_QUOTA2
if (fs->um_flags & ULFS_QUOTA2) {
error = lfsquota2_handle_cmd_delete(ump, qk);
error = lfsquota2_handle_cmd_del(ump, qk);
} else
#endif
panic("quota_handle_cmd_get: no support ?");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_quota.h,v 1.4 2013/06/06 00:49:28 dholland Exp $ */
/* $NetBSD: ulfs_quota.h,v 1.5 2014/06/28 22:27:51 dholland Exp $ */
/* from NetBSD: ufs_quota.h,v 1.21 2012/02/18 06:13:23 matt Exp */
/*
@ -131,7 +131,7 @@ int lfsquota2_handle_cmd_get(struct ulfsmount *, const struct quotakey *,
struct quotaval *);
int lfsquota2_handle_cmd_put(struct ulfsmount *, const struct quotakey *,
const struct quotaval *);
int lfsquota2_handle_cmd_delete(struct ulfsmount *, const struct quotakey *);
int lfsquota2_handle_cmd_del(struct ulfsmount *, const struct quotakey *);
int lfsquota2_handle_cmd_cursorget(struct ulfsmount *, struct quotakcursor *,
struct quotakey *, struct quotaval *, unsigned, unsigned *);
int lfsquota2_handle_cmd_cursoropen(struct ulfsmount *, struct quotakcursor *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_quota2.c,v 1.15 2013/10/18 19:45:40 christos Exp $ */
/* $NetBSD: ulfs_quota2.c,v 1.16 2014/06/28 22:27:51 dholland Exp $ */
/* from NetBSD: ufs_quota2.c,v 1.35 2012/09/27 07:47:56 bouyer Exp */
/* from NetBSD: ffs_quota2.c,v 1.4 2011/06/12 03:36:00 rmind Exp */
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota2.c,v 1.15 2013/10/18 19:45:40 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota2.c,v 1.16 2014/06/28 22:27:51 dholland Exp $");
#include <sys/buf.h>
#include <sys/param.h>
@ -672,7 +672,7 @@ dq2clear_callback(struct ulfsmount *ump, uint64_t *offp, struct quota2_entry *q2
return 0;
}
int
lfsquota2_handle_cmd_delete(struct ulfsmount *ump, const struct quotakey *qk)
lfsquota2_handle_cmd_del(struct ulfsmount *ump, const struct quotakey *qk)
{
int idtype;
id_t id;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota.c,v 1.116 2014/06/12 21:39:45 joerg Exp $ */
/* $NetBSD: ufs_quota.c,v 1.117 2014/06/28 22:27:51 dholland Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993, 1995
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.116 2014/06/12 21:39:45 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.117 2014/06/28 22:27:51 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -83,7 +83,7 @@ static int quota_handle_cmd_put(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_cursorget(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_delete(struct mount *, struct lwp *,
static int quota_handle_cmd_del(struct mount *, struct lwp *,
struct quotactl_args *args);
static int quota_handle_cmd_quotaon(struct mount *, struct lwp *,
struct quotactl_args *args);
@ -198,8 +198,8 @@ quota_handle_cmd(struct mount *mp, struct lwp *l,
case QUOTACTL_CURSORGET:
error = quota_handle_cmd_cursorget(mp, l, args);
break;
case QUOTACTL_DELETE:
error = quota_handle_cmd_delete(mp, l, args);
case QUOTACTL_DEL:
error = quota_handle_cmd_del(mp, l, args);
break;
case QUOTACTL_CURSOROPEN:
error = quota_handle_cmd_cursoropen(mp, l, args);
@ -427,7 +427,7 @@ quota_handle_cmd_put(struct mount *mp, struct lwp *l,
}
static int
quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
quota_handle_cmd_del(struct mount *mp, struct lwp *l,
struct quotactl_args *args)
{
struct ufsmount *ump = VFSTOUFS(mp);
@ -435,8 +435,8 @@ quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
id_t kauth_id;
int error;
KASSERT(args->qc_op == QUOTACTL_DELETE);
qk = args->u.remove.qc_key;
KASSERT(args->qc_op == QUOTACTL_DEL);
qk = args->u.del.qc_key;
kauth_id = qk->qk_id;
if (kauth_id == QUOTA_DEFAULTID) {
@ -455,7 +455,7 @@ quota_handle_cmd_delete(struct mount *mp, struct lwp *l,
goto err;
#ifdef QUOTA2
if (ump->um_flags & UFS_QUOTA2) {
error = quota2_handle_cmd_delete(ump, qk);
error = quota2_handle_cmd_del(ump, qk);
} else
#endif
panic("quota_handle_cmd_get: no support ?");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota.h,v 1.21 2012/02/18 06:13:23 matt Exp $ */
/* $NetBSD: ufs_quota.h,v 1.22 2014/06/28 22:27:51 dholland Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993, 1995
@ -130,7 +130,7 @@ int quota2_handle_cmd_get(struct ufsmount *, const struct quotakey *,
struct quotaval *);
int quota2_handle_cmd_put(struct ufsmount *, const struct quotakey *,
const struct quotaval *);
int quota2_handle_cmd_delete(struct ufsmount *, const struct quotakey *);
int quota2_handle_cmd_del(struct ufsmount *, const struct quotakey *);
int quota2_handle_cmd_cursorget(struct ufsmount *, struct quotakcursor *,
struct quotakey *, struct quotaval *, unsigned, unsigned *);
int quota2_handle_cmd_cursoropen(struct ufsmount *, struct quotakcursor *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota2.c,v 1.38 2014/03/16 01:21:35 uwe Exp $ */
/* $NetBSD: ufs_quota2.c,v 1.39 2014/06/28 22:27:51 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.38 2014/03/16 01:21:35 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.39 2014/06/28 22:27:51 dholland Exp $");
#include <sys/buf.h>
#include <sys/param.h>
@ -678,7 +678,7 @@ dq2clear_callback(struct ufsmount *ump, uint64_t *offp, struct quota2_entry *q2e
return 0;
}
int
quota2_handle_cmd_delete(struct ufsmount *ump, const struct quotakey *qk)
quota2_handle_cmd_del(struct ufsmount *ump, const struct quotakey *qk)
{
int idtype;
id_t id;