Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/puffs/mount_9p Use the typedef to declare tag in AU...
details: https://anonhg.NetBSD.org/src/rev/0491a4edd04d
branches: trunk
changeset: 933547:0491a4edd04d
user: uwe <uwe%NetBSD.org@localhost>
date: Tue May 26 22:54:43 2020 +0000
description:
Use the typedef to declare tag in AUTOVAR. Do not allocate 9P tags in
advance in AUTOVAR, do it right before we need them. Do no reuse tags.
If we are going to use sequential tags, we might as well try to make
them really sequential.
diffstat:
usr.sbin/puffs/mount_9p/ninepuffs.h | 4 ++--
usr.sbin/puffs/mount_9p/node.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diffs (108 lines):
diff -r d4cb7687817c -r 0491a4edd04d usr.sbin/puffs/mount_9p/ninepuffs.h
--- a/usr.sbin/puffs/mount_9p/ninepuffs.h Tue May 26 22:33:04 2020 +0000
+++ b/usr.sbin/puffs/mount_9p/ninepuffs.h Tue May 26 22:54:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ninepuffs.h,v 1.15 2019/10/28 02:59:25 ozaki-r Exp $ */
+/* $NetBSD: ninepuffs.h,v 1.16 2020/05/26 22:54:43 uwe Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -64,7 +64,7 @@
#define AUTOVAR(pu) \
struct puffs_cc *pcc = puffs_cc_getcc(pu); \
struct puffs9p *p9p = puffs_getspecific(pu); \
- uint16_t tag = NEXTTAG(p9p); \
+ p9ptag_t tag; \
struct puffs_framebuf *pb = p9pbuf_makeout(); \
int rv = 0
diff -r d4cb7687817c -r 0491a4edd04d usr.sbin/puffs/mount_9p/node.c
--- a/usr.sbin/puffs/mount_9p/node.c Tue May 26 22:33:04 2020 +0000
+++ b/usr.sbin/puffs/mount_9p/node.c Tue May 26 22:54:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: node.c,v 1.24 2020/05/26 22:08:11 uwe Exp $ */
+/* $NetBSD: node.c,v 1.25 2020/05/26 22:54:43 uwe Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: node.c,v 1.24 2020/05/26 22:08:11 uwe Exp $");
+__RCSID("$NetBSD: node.c,v 1.25 2020/05/26 22:54:43 uwe Exp $");
#endif /* !lint */
#include <assert.h>
@@ -57,6 +57,7 @@
AUTOVAR(pu);
struct p9pnode *p9n = pn->pn_data;
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_STAT);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n->fid_base);
@@ -97,6 +98,7 @@
struct qid9p newqid;
uint16_t nqid;
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_WALK);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n_dir->fid_base);
@@ -232,6 +234,7 @@
struct puffs_node *pn = opc;
struct p9pnode *p9n = pn->pn_data;
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_WSTAT);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n->fid_base);
@@ -327,6 +330,7 @@
nread = 0;
while (*resid > 0 && (uint64_t)(offset+nread) < pn->pn_va.va_size) {
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_READ);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n->fid_read);
@@ -374,6 +378,7 @@
while (*resid > 0) {
chunk = MIN(*resid, p9p->maxreq-32);
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_WRITE);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n->fid_write);
@@ -425,6 +430,7 @@
if (rv)
goto out;
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_CREATE);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, nfid);
@@ -448,6 +454,7 @@
nfid = NEXTFID(p9p);
p9pbuf_recycleout(pb);
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_WALK);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n->fid_base);
@@ -506,6 +513,7 @@
if (rv)
goto out;
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_REMOVE);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, testfid);
@@ -583,6 +591,7 @@
goto out;
}
+ tag = NEXTTAG(p9p);
p9pbuf_put_1(pb, P9PROTO_T_WSTAT);
p9pbuf_put_2(pb, tag);
p9pbuf_put_4(pb, p9n_src->fid_base);
Home |
Main Index |
Thread Index |
Old Index