[BACK]Return to vfs_quotactl.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

File: [cvs.NetBSD.org] / src / sys / kern / vfs_quotactl.c (download)

Revision 1.40, Sat Jun 28 22:27:50 2014 UTC (9 years, 9 months ago) by dholland
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, tls-maxphys-base, tls-earlyentropy-base, thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-sunxi-drm-base, bouyer-sunxi-drm, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache, HEAD
Changes since 1.39: +5 -5 lines

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.

/*	$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.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by David A. Holland.
 *
 * 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>
__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>

int
vfs_quotactl_stat(struct mount *mp, struct quotastat *info)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_STAT;
	args.u.stat.qc_info = info;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_idtypestat(struct mount *mp, int idtype,
    struct quotaidtypestat *info)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_IDTYPESTAT;
	args.u.idtypestat.qc_idtype = idtype;
	args.u.idtypestat.qc_info = info;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_objtypestat(struct mount *mp, int objtype,
    struct quotaobjtypestat *info)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_OBJTYPESTAT;
	args.u.objtypestat.qc_objtype = objtype;
	args.u.objtypestat.qc_info = info;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_get(struct mount *mp, const struct quotakey *key,
    struct quotaval *val)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_GET;
	args.u.get.qc_key = key;
	args.u.get.qc_val = val;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_put(struct mount *mp, const struct quotakey *key,
    const struct quotaval *val)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_PUT;
	args.u.put.qc_key = key;
	args.u.put.qc_val = val;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_del(struct mount *mp, const struct quotakey *key)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_DEL;
	args.u.del.qc_key = key;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursoropen(struct mount *mp, struct quotakcursor *cursor)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSOROPEN;
	args.u.cursoropen.qc_cursor = cursor;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursorclose(struct mount *mp, struct quotakcursor *cursor)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSORCLOSE;
	args.u.cursorclose.qc_cursor = cursor;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursorskipidtype(struct mount *mp, struct quotakcursor *cursor,
    int idtype)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSORSKIPIDTYPE;
	args.u.cursorskipidtype.qc_cursor = cursor;
	args.u.cursorskipidtype.qc_idtype = idtype;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursorget(struct mount *mp, struct quotakcursor *cursor,
    struct quotakey *keys, struct quotaval *vals, unsigned maxnum,
    unsigned *ret)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSORGET;
	args.u.cursorget.qc_cursor = cursor;
	args.u.cursorget.qc_keys = keys;
	args.u.cursorget.qc_vals = vals;
	args.u.cursorget.qc_maxnum = maxnum;
	args.u.cursorget.qc_ret = ret;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursoratend(struct mount *mp, struct quotakcursor *cursor,
    int *ret)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSORATEND;
	args.u.cursoratend.qc_cursor = cursor;
	args.u.cursoratend.qc_ret = ret;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_cursorrewind(struct mount *mp, struct quotakcursor *cursor)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_CURSORREWIND;
	args.u.cursorrewind.qc_cursor = cursor;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_quotaon(struct mount *mp, int idtype, const char *path)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_QUOTAON;
	args.u.quotaon.qc_idtype = idtype;
	args.u.quotaon.qc_quotafile = path;
	return VFS_QUOTACTL(mp, &args);
}

int
vfs_quotactl_quotaoff(struct mount *mp, int idtype)
{
	struct quotactl_args args;

	args.qc_op = QUOTACTL_QUOTAOFF;
	args.u.quotaoff.qc_idtype = idtype;
	return VFS_QUOTACTL(mp, &args);
}