Module Name: src Committed By: uwe Date: Tue May 26 22:33:05 UTC 2020
Modified Files: src/usr.sbin/puffs/mount_9p: nineproto.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/puffs/mount_9p/nineproto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/puffs/mount_9p/nineproto.c diff -u src/usr.sbin/puffs/mount_9p/nineproto.c:1.12 src/usr.sbin/puffs/mount_9p/nineproto.c:1.13 --- src/usr.sbin/puffs/mount_9p/nineproto.c:1.12 Tue May 26 19:41:36 2020 +++ src/usr.sbin/puffs/mount_9p/nineproto.c Tue May 26 22:33:04 2020 @@ -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 @@ proto_cc_dupfid(struct puffs_usermount * 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 @@ proto_cc_clunkfid(struct puffs_usermount 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 @@ proto_cc_open(struct puffs_usermount *pu 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 @@ proto_cc_open(struct puffs_usermount *pu 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);