Module Name:    src
Committed By:   bouyer
Date:           Mon Feb 14 20:35:24 UTC 2011

Modified Files:
        src/libexec/rpc.rquotad [bouyer-quota2]: Makefile rquotad.c
        src/usr.bin/quota [bouyer-quota2]: Makefile quota.c

Log Message:
The rpc.rquotad protocol uses the legacy definitions and integer types.
Convert from/to dqblk using the quota1_subr.c routines to have the
necessery convertions done.


To generate a diff of this commit:
cvs rdiff -u -r1.6.64.1 -r1.6.64.2 src/libexec/rpc.rquotad/Makefile
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/libexec/rpc.rquotad/rquotad.c
cvs rdiff -u -r1.6.64.4 -r1.6.64.5 src/usr.bin/quota/Makefile
cvs rdiff -u -r1.33.2.7 -r1.33.2.8 src/usr.bin/quota/quota.c

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

Modified files:

Index: src/libexec/rpc.rquotad/Makefile
diff -u src/libexec/rpc.rquotad/Makefile:1.6.64.1 src/libexec/rpc.rquotad/Makefile:1.6.64.2
--- src/libexec/rpc.rquotad/Makefile:1.6.64.1	Tue Feb  8 22:14:22 2011
+++ src/libexec/rpc.rquotad/Makefile	Mon Feb 14 20:35:24 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6.64.1 2011/02/08 22:14:22 bouyer Exp $
+#	$NetBSD: Makefile,v 1.6.64.2 2011/02/14 20:35:24 bouyer Exp $
 
 .include <bsd.own.mk>
 PROG =	rpc.rquotad
@@ -13,7 +13,7 @@
 .PATH:  ${NETBSDSRCDIR}/usr.bin/quota
 SRCS+=	getvfsquota.c
 .PATH:  ${NETBSDSRCDIR}/sys/ufs/ufs
-SRCS+=	quota2_prop.c
+SRCS+=	quota2_prop.c quota1_subr.c
 
 
 .include <bsd.prog.mk>

Index: src/libexec/rpc.rquotad/rquotad.c
diff -u src/libexec/rpc.rquotad/rquotad.c:1.24.2.1 src/libexec/rpc.rquotad/rquotad.c:1.24.2.2
--- src/libexec/rpc.rquotad/rquotad.c:1.24.2.1	Tue Feb  8 22:14:22 2011
+++ src/libexec/rpc.rquotad/rquotad.c	Mon Feb 14 20:35:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rquotad.c,v 1.24.2.1 2011/02/08 22:14:22 bouyer Exp $	*/
+/*	$NetBSD: rquotad.c,v 1.24.2.2 2011/02/14 20:35:24 bouyer Exp $	*/
 
 /*
  * by Manuel Bouyer ([email protected]). Public domain.
@@ -6,7 +6,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rquotad.c,v 1.24.2.1 2011/02/08 22:14:22 bouyer Exp $");
+__RCSID("$NetBSD: rquotad.c,v 1.24.2.2 2011/02/14 20:35:24 bouyer Exp $");
 #endif
 
 #include <sys/param.h>
@@ -30,6 +30,7 @@
 #include <syslog.h>
 
 #include <ufs/ufs/quota2_prop.h>
+#include <ufs/ufs/quota1.h>
 #include <rpc/rpc.h>
 #include <rpcsvc/rquota.h>
 #include <arpa/inet.h>
@@ -164,6 +165,7 @@
 	struct ext_getquota_args ext_getq_args;
 	struct getquota_rslt getq_rslt;
 	struct quota2_entry q2e;
+	struct dqblk dqblk;
 	int type;
 	int8_t version;
 	struct timeval timev;
@@ -207,26 +209,27 @@
 		/* failed, return noquota */
 		getq_rslt.status = Q_NOQUOTA;
 	} else {
+		q2e2dqblk(&q2e, &dqblk);
 		gettimeofday(&timev, NULL);
 		getq_rslt.status = Q_OK;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_active = TRUE;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize = DEV_BSIZE;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit =
-		    q2e.q2e_val[QL_BLOCK].q2v_hardlimit;
+		    dqblk.dqb_bhardlimit;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit =
-		    q2e.q2e_val[QL_BLOCK].q2v_softlimit;
+		    dqblk.dqb_bsoftlimit;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks =
-		    q2e.q2e_val[QL_BLOCK].q2v_cur;
+		    dqblk.dqb_curblocks;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit =
-		    q2e.q2e_val[QL_FILE].q2v_hardlimit;
+		    dqblk.dqb_ihardlimit;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit =
-		    q2e.q2e_val[QL_FILE].q2v_softlimit;
+		    dqblk.dqb_isoftlimit;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles =
-		    q2e.q2e_val[QL_FILE].q2v_softlimit;
+		    dqblk.dqb_curinodes;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft =
-		    q2e.q2e_val[QL_BLOCK].q2v_time - timev.tv_sec;
+		    dqblk.dqb_btime;
 		getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft =
-		    q2e.q2e_val[QL_FILE].q2v_time - timev.tv_sec;
+		    dqblk.dqb_itime;
 	}
 out:
 	if (!svc_sendreply(transp, xdr_getquota_rslt, (char *)&getq_rslt))

Index: src/usr.bin/quota/Makefile
diff -u src/usr.bin/quota/Makefile:1.6.64.4 src/usr.bin/quota/Makefile:1.6.64.5
--- src/usr.bin/quota/Makefile:1.6.64.4	Thu Feb  3 15:56:15 2011
+++ src/usr.bin/quota/Makefile	Mon Feb 14 20:35:24 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6.64.4 2011/02/03 15:56:15 bouyer Exp $	
+#	$NetBSD: Makefile,v 1.6.64.5 2011/02/14 20:35:24 bouyer Exp $	
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -10,5 +10,5 @@
 LDADD=	-lrpcsvc -lprop
 
 .PATH:	${NETBSDSRCDIR}/sys/ufs/ufs 
-SRCS+=	quota2_prop.c quota2_subr.c
+SRCS+=	quota2_prop.c quota2_subr.c quota1_subr.c
 .include <bsd.prog.mk>

Index: src/usr.bin/quota/quota.c
diff -u src/usr.bin/quota/quota.c:1.33.2.7 src/usr.bin/quota/quota.c:1.33.2.8
--- src/usr.bin/quota/quota.c:1.33.2.7	Thu Feb  3 15:56:15 2011
+++ src/usr.bin/quota/quota.c	Mon Feb 14 20:35:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: quota.c,v 1.33.2.7 2011/02/03 15:56:15 bouyer Exp $	*/
+/*	$NetBSD: quota.c,v 1.33.2.8 2011/02/14 20:35:24 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)quota.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: quota.c,v 1.33.2.7 2011/02/03 15:56:15 bouyer Exp $");
+__RCSID("$NetBSD: quota.c,v 1.33.2.8 2011/02/14 20:35:24 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,6 +70,7 @@
 #include <unistd.h>
 
 #include <ufs/ufs/quota2.h>
+#include <ufs/ufs/quota1.h>
 
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
@@ -543,6 +544,7 @@
 	struct ext_getquota_args ext_gq_args;
 	struct getquota_rslt gq_rslt;
 	struct quota2_entry *q2e = &qup->q2e;
+	struct dqblk dqblk;
 	struct timeval tv;
 	char *cp;
 	int ret;
@@ -599,26 +601,28 @@
 		gettimeofday(&tv, NULL);
 			/* blocks*/
 		q2e->q2e_val[QL_BLOCK].q2v_hardlimit =
+		dqblk.dqb_bhardlimit =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
 		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
-		q2e->q2e_val[QL_BLOCK].q2v_softlimit =
+		dqblk.dqb_bsoftlimit =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
 		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
-		q2e->q2e_val[QL_BLOCK].q2v_cur =
+		dqblk.dqb_curblocks =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
 		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
 			/* inodes */
-		q2e->q2e_val[QL_FILE].q2v_hardlimit =
+		dqblk.dqb_ihardlimit =
 			gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;
-		q2e->q2e_val[QL_FILE].q2v_softlimit =
+		dqblk.dqb_isoftlimit =
 			gq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit;
-		q2e->q2e_val[QL_FILE].q2v_cur =
+		dqblk.dqb_curinodes =
 			gq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles;
 			/* grace times */
-		q2e->q2e_val[QL_BLOCK].q2v_time =
+		dqblk.dqb_btime =
 		    tv.tv_sec + gq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft;
-		q2e->q2e_val[QL_FILE].q2v_time =
+		dqblk.dqb_itime =
 		    tv.tv_sec + gq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft;
+		dqblk2q2e(&dqblk, q2e);
 		*cp = ':';
 		return (1);
 	default:

Reply via email to