From ed8dccd5f3d0221177b210ac427860ae72283271 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 22 Jul 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-07-22 --- port/devmnt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/port/devmnt.c b/port/devmnt.c index 8daef19b94a07242bada30e8ee1c85ff85f18efe..991120f539eecff0f5a4f668dbca7aab5f6e9b9f 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -36,7 +36,6 @@ struct Mntalloc }mntalloc; #define MAXRPC (16*1024+MAXMSG) -#define limit(n, max) (n > max ? max : n) void mattach(Mnt*, Chan*, char*); void mntauth(Mnt*, Mntrpc*, char*, ushort); @@ -584,7 +583,13 @@ mntrdwr(int type, Chan *c, void *buf, long n, vlong off) r->request.fid = c->fid; r->request.offset = off; r->request.data = uba; - r->request.count = limit(n, m->blocksize); + if(n > m->blocksize){ + if(c->qid.path & CHDIR) + r->request.count = (m->blocksize/DIRLEN)*DIRLEN; + else + r->request.count = m->blocksize; + } else + r->request.count = n; mountrpc(m, r); nreq = r->request.count; nr = r->reply.count;