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 Do not allocate 9P tags in advance, ...



details:   https://anonhg.NetBSD.org/src/rev/d4cb7687817c
branches:  trunk
changeset: 933546:d4cb7687817c
user:      uwe <uwe%NetBSD.org@localhost>
date:      Tue May 26 22:33:04 2020 +0000

description:
Do not allocate 9P tags in advance, do it right before we need them.
If we are going to use sequential tags, we might as well try to make
them really sequential.

diffstat:

 usr.sbin/puffs/mount_9p/nineproto.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (62 lines):

diff -r bb0c4fd6e381 -r d4cb7687817c usr.sbin/puffs/mount_9p/nineproto.c
--- a/usr.sbin/puffs/mount_9p/nineproto.c       Tue May 26 22:08:11 2020 +0000
+++ b/usr.sbin/puffs/mount_9p/nineproto.c       Tue May 26 22:33:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nineproto.c,v 1.12 2020/05/26 19:41:36 uwe Exp $       */
+/*     $NetBSD: nineproto.c,v 1.13 2020/05/26 22:33:04 uwe Exp $       */
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: nineproto.c,v 1.12 2020/05/26 19:41:36 uwe Exp $");
+__RCSID("$NetBSD: nineproto.c,v 1.13 2020/05/26 22:33:04 uwe Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -233,11 +233,12 @@
        struct puffs_cc *pcc = puffs_cc_getcc(pu);
        struct puffs9p *p9p = puffs_getspecific(pu);
        struct puffs_framebuf *pb;
-       p9ptag_t tag = NEXTTAG(p9p);
+       p9ptag_t tag;
        uint16_t qids;
        int rv = 0;
 
        pb = p9pbuf_makeout();
+       tag = NEXTTAG(p9p);
        p9pbuf_put_1(pb, P9PROTO_T_WALK);
        p9pbuf_put_2(pb, tag);
        p9pbuf_put_4(pb, oldfid);
@@ -260,10 +261,11 @@
        struct puffs_cc *pcc = puffs_cc_getcc(pu);
        struct puffs9p *p9p = puffs_getspecific(pu);
        struct puffs_framebuf *pb;
-       p9ptag_t tag = NEXTTAG(p9p);
+       p9ptag_t tag;
        int rv = 0;
 
        pb = p9pbuf_makeout();
+       tag = NEXTTAG(p9p);
        p9pbuf_put_1(pb, P9PROTO_T_CLUNK);
        p9pbuf_put_2(pb, tag);
        p9pbuf_put_4(pb, fid);
@@ -294,7 +296,7 @@
        struct puffs_cc *pcc = puffs_cc_getcc(pu);
        struct puffs9p *p9p = puffs_getspecific(pu);
        struct puffs_framebuf *pb;
-       p9ptag_t tag = NEXTTAG(p9p);
+       p9ptag_t tag;
        int rv;
 
        rv = proto_cc_dupfid(pu, fid, newfid);
@@ -302,6 +304,7 @@
                return rv;
 
        pb = p9pbuf_makeout();
+       tag = NEXTTAG(p9p);
        p9pbuf_put_1(pb, P9PROTO_T_OPEN);
        p9pbuf_put_2(pb, tag);
        p9pbuf_put_4(pb, newfid);



Home | Main Index | Thread Index | Old Index