Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/bouyer-quota2]: src The rpc.rquotad protocol uses the legacy definitions...
details: https://anonhg.NetBSD.org/src/rev/f93b30bbbd86
branches: bouyer-quota2
changeset: 761175:f93b30bbbd86
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Feb 14 20:35:24 2011 +0000
description:
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.
diffstat:
libexec/rpc.rquotad/Makefile | 4 ++--
libexec/rpc.rquotad/rquotad.c | 23 +++++++++++++----------
usr.bin/quota/Makefile | 4 ++--
usr.bin/quota/quota.c | 22 +++++++++++++---------
4 files changed, 30 insertions(+), 23 deletions(-)
diffs (174 lines):
diff -r 89423871362b -r f93b30bbbd86 libexec/rpc.rquotad/Makefile
--- a/libexec/rpc.rquotad/Makefile Mon Feb 14 15:38:16 2011 +0000
+++ b/libexec/rpc.rquotad/Makefile Mon Feb 14 20:35:24 2011 +0000
@@ -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>
diff -r 89423871362b -r f93b30bbbd86 libexec/rpc.rquotad/rquotad.c
--- a/libexec/rpc.rquotad/rquotad.c Mon Feb 14 15:38:16 2011 +0000
+++ b/libexec/rpc.rquotad/rquotad.c Mon Feb 14 20:35:24 2011 +0000
@@ -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 (bouyer%ensta.fr@localhost). 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))
diff -r 89423871362b -r f93b30bbbd86 usr.bin/quota/Makefile
--- a/usr.bin/quota/Makefile Mon Feb 14 15:38:16 2011 +0000
+++ b/usr.bin/quota/Makefile Mon Feb 14 20:35:24 2011 +0000
@@ -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>
diff -r 89423871362b -r f93b30bbbd86 usr.bin/quota/quota.c
--- a/usr.bin/quota/quota.c Mon Feb 14 15:38:16 2011 +0000
+++ b/usr.bin/quota/quota.c Mon Feb 14 20:35:24 2011 +0000
@@ -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:
Home |
Main Index |
Thread Index |
Old Index