Module Name:    src
Committed By:   dholland
Date:           Sun Jan 29 07:14:39 UTC 2012

Modified Files:
        src/sys/kern: vfs_quotactl.c vfs_subr.c
        src/sys/miscfs/genfs: layer_extern.h layer_vfsops.c
        src/sys/sys: mount.h
        src/sys/ufs/ufs: ufs_extern.h ufs_quota.c ufs_vfsops.c

Log Message:
Remove the extra op argument to VFS_QUOTACTL() - the op is now stored
purely in the args structure.

This change requires a kernel version bump.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/vfs_quotactl.c
cvs rdiff -u -r1.430 -r1.431 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/miscfs/genfs/layer_extern.h
cvs rdiff -u -r1.37 -r1.38 src/sys/miscfs/genfs/layer_vfsops.c
cvs rdiff -u -r1.205 -r1.206 src/sys/sys/mount.h
cvs rdiff -u -r1.69 -r1.70 src/sys/ufs/ufs/ufs_extern.h
cvs rdiff -u -r1.102 -r1.103 src/sys/ufs/ufs/ufs_quota.c
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/ufs/ufs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_quotactl.c
diff -u src/sys/kern/vfs_quotactl.c:1.34 src/sys/kern/vfs_quotactl.c:1.35
--- src/sys/kern/vfs_quotactl.c:1.34	Sun Jan 29 07:13:42 2012
+++ src/sys/kern/vfs_quotactl.c	Sun Jan 29 07:14:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_quotactl.c,v 1.34 2012/01/29 07:13:42 dholland Exp $	*/
+/*	$NetBSD: vfs_quotactl.c,v 1.35 2012/01/29 07:14:38 dholland Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993, 1994
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.34 2012/01/29 07:13:42 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_quotactl.c,v 1.35 2012/01/29 07:14:38 dholland Exp $");
 
 #include <sys/malloc.h> /* XXX: temporary */
 #include <sys/mount.h>
@@ -105,7 +105,7 @@ vfs_quotactl_getversion(struct mount *mp
 
 	args.qc_op = QUOTACTL_STAT;
 	args.u.stat.qc_ret = &stat;
-	error = VFS_QUOTACTL(mp, QUOTACTL_STAT, &args);
+	error = VFS_QUOTACTL(mp, &args);
 	if (error) {
 		return error;
 	}
@@ -176,7 +176,7 @@ vfs_quotactl_quotaon(struct mount *mp,
 	args.qc_op = QUOTACTL_QUOTAON;
 	args.u.quotaon.qc_idtype = q2type;
 	args.u.quotaon.qc_quotafile = qfile;
-	return VFS_QUOTACTL(mp, QUOTACTL_QUOTAON, &args);
+	return VFS_QUOTACTL(mp, &args);
 }
 
 static int
@@ -194,7 +194,7 @@ vfs_quotactl_quotaoff(struct mount *mp,
 
 	args.qc_op = QUOTACTL_QUOTAOFF;
 	args.u.quotaoff.qc_idtype = q2type;
-	return VFS_QUOTACTL(mp, QUOTACTL_QUOTAOFF, &args);
+	return VFS_QUOTACTL(mp, &args);
 }
 
 static int
@@ -283,7 +283,7 @@ vfs_quotactl_get(struct mount *mp,
 		args.qc_op = QUOTACTL_GET;
 		args.u.get.qc_key = &qk;
 		args.u.get.qc_ret = &blocks;
-		error = VFS_QUOTACTL(mp, QUOTACTL_GET, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error == EPERM) {
 			/* XXX does this make sense? */
 			continue;
@@ -299,7 +299,7 @@ vfs_quotactl_get(struct mount *mp,
 		args.qc_op = QUOTACTL_GET;
 		args.u.get.qc_key = &qk;
 		args.u.get.qc_ret = &files;
-		error = VFS_QUOTACTL(mp, QUOTACTL_GET, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error == EPERM) {
 			/* XXX does this make sense? */
 			continue;
@@ -438,7 +438,7 @@ vfs_quotactl_put(struct mount *mp,
 		args.qc_op = QUOTACTL_PUT;
 		args.u.put.qc_key = &qk;
 		args.u.put.qc_val = &blocks;
-		error = VFS_QUOTACTL(mp, QUOTACTL_PUT, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error) {
 			goto err;
 		}
@@ -450,7 +450,7 @@ vfs_quotactl_put(struct mount *mp,
 		args.qc_op = QUOTACTL_PUT;
 		args.u.put.qc_key = &qk;
 		args.u.put.qc_val = &files;
-		error = VFS_QUOTACTL(mp, QUOTACTL_PUT, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error) {
 			goto err;
 		}
@@ -574,7 +574,7 @@ vfs_quotactl_getall(struct mount *mp,
 
 	args.qc_op = QUOTACTL_CURSOROPEN;
 	args.u.cursoropen.qc_cursor = &cursor;
-	error = VFS_QUOTACTL(mp, QUOTACTL_CURSOROPEN, &args);
+	error = VFS_QUOTACTL(mp, &args);
 	if (error) {
 		return error;
 	}
@@ -587,7 +587,7 @@ vfs_quotactl_getall(struct mount *mp,
 	args.qc_op = QUOTACTL_CURSORSKIPIDTYPE;
 	args.u.cursorskipidtype.qc_cursor = &cursor;
 	args.u.cursorskipidtype.qc_idtype = skipidtype;
-	error = VFS_QUOTACTL(mp, QUOTACTL_CURSORSKIPIDTYPE, &args);
+	error = VFS_QUOTACTL(mp, &args);
 	/* ignore if it fails */
 	(void)error;
 
@@ -605,7 +605,7 @@ vfs_quotactl_getall(struct mount *mp,
 		args.qc_op = QUOTACTL_CURSORATEND;
 		args.u.cursoratend.qc_cursor = &cursor;
 		args.u.cursoratend.qc_ret = &atend;
-		error = VFS_QUOTACTL(mp, QUOTACTL_CURSORATEND, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error) {
 			goto err;
 		}
@@ -620,7 +620,7 @@ vfs_quotactl_getall(struct mount *mp,
 		args.u.cursorget.qc_maxnum = loopmax;
 		args.u.cursorget.qc_ret = &loopnum;
 
-		error = VFS_QUOTACTL(mp, QUOTACTL_CURSORGET, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error == EDEADLK) {
 			/*
 			 * transaction abort, start over
@@ -628,7 +628,7 @@ vfs_quotactl_getall(struct mount *mp,
 
 			args.qc_op = QUOTACTL_CURSORREWIND;
 			args.u.cursorrewind.qc_cursor = &cursor;
-			error = VFS_QUOTACTL(mp, QUOTACTL_CURSORREWIND, &args);
+			error = VFS_QUOTACTL(mp, &args);
 			if (error) {
 				goto err;
 			}
@@ -636,8 +636,7 @@ vfs_quotactl_getall(struct mount *mp,
 			args.qc_op = QUOTACTL_CURSORSKIPIDTYPE;
 			args.u.cursorskipidtype.qc_cursor = &cursor;
 			args.u.cursorskipidtype.qc_idtype = skipidtype;
-			error = VFS_QUOTACTL(mp, QUOTACTL_CURSORSKIPIDTYPE,
-					     &args);
+			error = VFS_QUOTACTL(mp, &args);
 			/* ignore if it fails */
 			(void)error;
 
@@ -731,7 +730,7 @@ vfs_quotactl_getall(struct mount *mp,
 
 	args.qc_op = QUOTACTL_CURSORCLOSE;
 	args.u.cursorclose.qc_cursor = &cursor;
-	error2 = VFS_QUOTACTL(mp, QUOTACTL_CURSORCLOSE, &args);
+	error2 = VFS_QUOTACTL(mp, &args);
 
 	if (error) {
 		return error;
@@ -787,7 +786,7 @@ vfs_quotactl_clear(struct mount *mp,
 
 		args.qc_op = QUOTACTL_DELETE;
 		args.u.delete.qc_key = &qk;
-		error = VFS_QUOTACTL(mp, QUOTACTL_DELETE, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error) {
 			goto err;
 		}
@@ -798,7 +797,7 @@ vfs_quotactl_clear(struct mount *mp,
 
 		args.qc_op = QUOTACTL_DELETE;
 		args.u.delete.qc_key = &qk;
-		error = VFS_QUOTACTL(mp, QUOTACTL_DELETE, &args);
+		error = VFS_QUOTACTL(mp, &args);
 		if (error) {
 			goto err;
 		}

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.430 src/sys/kern/vfs_subr.c:1.431
--- src/sys/kern/vfs_subr.c:1.430	Sun Jan 29 07:13:42 2012
+++ src/sys/kern/vfs_subr.c	Sun Jan 29 07:14:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.430 2012/01/29 07:13:42 dholland Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.431 2012/01/29 07:14:38 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.430 2012/01/29 07:13:42 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.431 2012/01/29 07:14:38 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -90,7 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v
 #include <sys/syscallargs.h>
 #include <sys/kauth.h>
 #include <sys/module.h>
-#include <sys/quotactl.h> /* XXX temporary */
 
 #include <miscfs/genfs/genfs.h>
 #include <miscfs/syncfs/syncfs.h>
@@ -1007,16 +1006,14 @@ VFS_ROOT(struct mount *mp, struct vnode 
 }
 
 int
-VFS_QUOTACTL(struct mount *mp, int op, struct vfs_quotactl_args *args)
+VFS_QUOTACTL(struct mount *mp, struct vfs_quotactl_args *args)
 {
 	int error;
 
-	KASSERT(op == args->qc_op);
-
 	if ((mp->mnt_iflag & IMNT_MPSAFE) == 0) {
 		KERNEL_LOCK(1, NULL);
 	}
-	error = (*(mp->mnt_op->vfs_quotactl))(mp, op, args);
+	error = (*(mp->mnt_op->vfs_quotactl))(mp, args);
 	if ((mp->mnt_iflag & IMNT_MPSAFE) == 0) {
 		KERNEL_UNLOCK_ONE(NULL);
 	}

Index: src/sys/miscfs/genfs/layer_extern.h
diff -u src/sys/miscfs/genfs/layer_extern.h:1.32 src/sys/miscfs/genfs/layer_extern.h:1.33
--- src/sys/miscfs/genfs/layer_extern.h:1.32	Sun Jan 29 06:36:06 2012
+++ src/sys/miscfs/genfs/layer_extern.h	Sun Jan 29 07:14:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: layer_extern.h,v 1.32 2012/01/29 06:36:06 dholland Exp $	*/
+/*	$NetBSD: layer_extern.h,v 1.33 2012/01/29 07:14:39 dholland Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -88,7 +88,7 @@ struct vnode *layer_node_find(struct mou
 /* VFS routines */
 int	layerfs_start(struct mount *, int);
 int	layerfs_root(struct mount *, struct vnode **);
-int	layerfs_quotactl(struct mount *, int, struct vfs_quotactl_args *);
+int	layerfs_quotactl(struct mount *, struct vfs_quotactl_args *);
 int	layerfs_statvfs(struct mount *, struct statvfs *);
 int	layerfs_sync(struct mount *, int, struct kauth_cred *);
 int	layerfs_vget(struct mount *, ino_t, struct vnode **);

Index: src/sys/miscfs/genfs/layer_vfsops.c
diff -u src/sys/miscfs/genfs/layer_vfsops.c:1.37 src/sys/miscfs/genfs/layer_vfsops.c:1.38
--- src/sys/miscfs/genfs/layer_vfsops.c:1.37	Sun Jan 29 06:36:06 2012
+++ src/sys/miscfs/genfs/layer_vfsops.c	Sun Jan 29 07:14:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: layer_vfsops.c,v 1.37 2012/01/29 06:36:06 dholland Exp $	*/
+/*	$NetBSD: layer_vfsops.c,v 1.38 2012/01/29 07:14:39 dholland Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.37 2012/01/29 06:36:06 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.38 2012/01/29 07:14:39 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -141,10 +141,10 @@ layerfs_root(struct mount *mp, struct vn
 }
 
 int
-layerfs_quotactl(struct mount *mp, int op, struct vfs_quotactl_args *args)
+layerfs_quotactl(struct mount *mp, struct vfs_quotactl_args *args)
 {
 
-	return VFS_QUOTACTL(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, op, args);
+	return VFS_QUOTACTL(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, args);
 }
 
 int

Index: src/sys/sys/mount.h
diff -u src/sys/sys/mount.h:1.205 src/sys/sys/mount.h:1.206
--- src/sys/sys/mount.h:1.205	Sun Jan 29 06:36:06 2012
+++ src/sys/sys/mount.h	Sun Jan 29 07:14:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.205 2012/01/29 06:36:06 dholland Exp $	*/
+/*	$NetBSD: mount.h,v 1.206 2012/01/29 07:14:38 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -209,7 +209,7 @@ struct vfsops {
 	int	(*vfs_start)	(struct mount *, int);
 	int	(*vfs_unmount)	(struct mount *, int);
 	int	(*vfs_root)	(struct mount *, struct vnode **);
-	int	(*vfs_quotactl)	(struct mount *, int, struct vfs_quotactl_args *);
+	int	(*vfs_quotactl)	(struct mount *, struct vfs_quotactl_args *);
 	int	(*vfs_statvfs)	(struct mount *, struct statvfs *);
 	int	(*vfs_sync)	(struct mount *, int, struct kauth_cred *);
 	int	(*vfs_vget)	(struct mount *, ino_t, struct vnode **);
@@ -244,7 +244,7 @@ int	VFS_MOUNT(struct mount *, const char
 int	VFS_START(struct mount *, int);
 int	VFS_UNMOUNT(struct mount *, int);
 int	VFS_ROOT(struct mount *, struct vnode **);
-int	VFS_QUOTACTL(struct mount *, int, struct vfs_quotactl_args *);
+int	VFS_QUOTACTL(struct mount *, struct vfs_quotactl_args *);
 int	VFS_STATVFS(struct mount *, struct statvfs *);
 int	VFS_SYNC(struct mount *, int, struct kauth_cred *);
 int	VFS_FHTOVP(struct mount *, struct fid *, struct vnode **);

Index: src/sys/ufs/ufs/ufs_extern.h
diff -u src/sys/ufs/ufs/ufs_extern.h:1.69 src/sys/ufs/ufs/ufs_extern.h:1.70
--- src/sys/ufs/ufs/ufs_extern.h:1.69	Sun Jan 29 06:36:07 2012
+++ src/sys/ufs/ufs/ufs_extern.h	Sun Jan 29 07:14:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extern.h,v 1.69 2012/01/29 06:36:07 dholland Exp $	*/
+/*	$NetBSD: ufs_extern.h,v 1.70 2012/01/29 07:14:38 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -148,7 +148,7 @@ void	ufsquota_init(struct inode *);
 void	ufsquota_free(struct inode *);
 int	chkdq(struct inode *, int64_t, kauth_cred_t, int);
 int	chkiq(struct inode *, int32_t, kauth_cred_t, int);
-int	quota_handle_cmd(struct mount *, struct lwp *, int,
+int	quota_handle_cmd(struct mount *, struct lwp *,
 			 struct vfs_quotactl_args *);
 
 int	qsync(struct mount *);
@@ -165,7 +165,7 @@ void	ufs_reinit(void);
 void	ufs_done(void);
 int	ufs_start(struct mount *, int);
 int	ufs_root(struct mount *, struct vnode **);
-int	ufs_quotactl(struct mount *, int, struct vfs_quotactl_args *);
+int	ufs_quotactl(struct mount *, struct vfs_quotactl_args *);
 int	ufs_fhtovp(struct mount *, struct ufid *, struct vnode **);
 
 /* ufs_vnops.c */

Index: src/sys/ufs/ufs/ufs_quota.c
diff -u src/sys/ufs/ufs/ufs_quota.c:1.102 src/sys/ufs/ufs/ufs_quota.c:1.103
--- src/sys/ufs/ufs/ufs_quota.c:1.102	Sun Jan 29 07:13:43 2012
+++ src/sys/ufs/ufs/ufs_quota.c	Sun Jan 29 07:14:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_quota.c,v 1.102 2012/01/29 07:13:43 dholland Exp $	*/
+/*	$NetBSD: ufs_quota.c,v 1.103 2012/01/29 07:14:38 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.102 2012/01/29 07:13:43 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.103 2012/01/29 07:14:38 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -164,12 +164,12 @@ chkiq(struct inode *ip, int32_t change, 
 }
 
 int
-quota_handle_cmd(struct mount *mp, struct lwp *l, int op,
+quota_handle_cmd(struct mount *mp, struct lwp *l,
 		 struct vfs_quotactl_args *args)
 {
 	int error = 0;
 
-	switch (op) {
+	switch (args->qc_op) {
 	    case QUOTACTL_STAT:
 		error = quota_handle_cmd_stat(mp, l, args);
 		break;
@@ -207,7 +207,7 @@ quota_handle_cmd(struct mount *mp, struc
 		error = quota_handle_cmd_cursorrewind(mp, l, args);
 		break;
 	    default:
-		panic("Invalid quotactl operation %d\n", op);
+		panic("Invalid quotactl operation %d\n", args->qc_op);
 	}
 
 	return error;

Index: src/sys/ufs/ufs/ufs_vfsops.c
diff -u src/sys/ufs/ufs/ufs_vfsops.c:1.46 src/sys/ufs/ufs/ufs_vfsops.c:1.47
--- src/sys/ufs/ufs/ufs_vfsops.c:1.46	Sun Jan 29 06:36:07 2012
+++ src/sys/ufs/ufs/ufs_vfsops.c	Sun Jan 29 07:14:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vfsops.c,v 1.46 2012/01/29 06:36:07 dholland Exp $	*/
+/*	$NetBSD: ufs_vfsops.c,v 1.47 2012/01/29 07:14:39 dholland Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.46 2012/01/29 06:36:07 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.47 2012/01/29 07:14:39 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -101,7 +101,7 @@ ufs_root(struct mount *mp, struct vnode 
  * Do operations associated with quotas
  */
 int
-ufs_quotactl(struct mount *mp, int op, struct vfs_quotactl_args *args)
+ufs_quotactl(struct mount *mp, struct vfs_quotactl_args *args)
 {
 	struct lwp *l = curlwp;
 
@@ -121,7 +121,7 @@ ufs_quotactl(struct mount *mp, int op, s
 	}
 	mutex_enter(&mp->mnt_updating);
 
-	error = quota_handle_cmd(mp, l, op, args);
+	error = quota_handle_cmd(mp, l, args);
 
 	mutex_exit(&mp->mnt_updating);
 	vfs_unbusy(mp, false, NULL);

Reply via email to