From d8d433894a706ec65384bd8a18630d18912f0f78 Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Sun, 5 Jun 2022 12:29:50 +0000 Subject: [PATCH] kernel: cleanup unused fields from devpipe We don't need to multiply session path by 2, the definition for NETQID is: Meaning we don't need to save room between session paths for individual Qid paths. This doubles the amount of pipe sessions we can have before a wrap. --- sys/src/9/port/devpipe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/src/9/port/devpipe.c b/sys/src/9/port/devpipe.c index 60c6edd13..8611681a4 100644 --- a/sys/src/9/port/devpipe.c +++ b/sys/src/9/port/devpipe.c @@ -11,9 +11,7 @@ typedef struct Pipe Pipe; struct Pipe { QLock; - Pipe *next; int ref; - ulong path; Queue *q[2]; int qref[2]; }; @@ -57,6 +55,7 @@ pipeattach(char *spec) { Pipe *p; Chan *c; + ulong path; c = devattach('|', spec); if(waserror()){ @@ -82,10 +81,10 @@ pipeattach(char *spec) poperror(); lock(&pipealloc); - p->path = ++pipealloc.path; + path = ++pipealloc.path; unlock(&pipealloc); - mkqid(&c->qid, NETQID(2*p->path, Qdir), 0, QTDIR); + mkqid(&c->qid, NETQID(path, Qdir), 0, QTDIR); c->aux = p; c->dev = 0; return c;