X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=sys%2Fsrc%2Fcmd%2F9660srv%2Fiobuf.c;h=a617483e61862976dfe4a0ef8e7f576558a56190;hb=2e85e328864c215c2efa228f129ce3fa6aa1db1f;hp=6bba533e8fec6e3465f8597641a9d20346656ee4;hpb=f5688dd6c9bfb6cee00f2c5e5f190d7a2ffaa6c6;p=plan9front.git diff --git a/sys/src/cmd/9660srv/iobuf.c b/sys/src/cmd/9660srv/iobuf.c index 6bba533e8..a617483e6 100644 --- a/sys/src/cmd/9660srv/iobuf.c +++ b/sys/src/cmd/9660srv/iobuf.c @@ -31,7 +31,7 @@ int nclust = NCLUST; static Ioclust* iohead; static Ioclust* iotail; -static Ioclust* getclust(Xdata*, long); +static Ioclust* getclust(Xdata*, long, ulong); static void putclust(Ioclust*); static void xread(Ioclust*); @@ -53,6 +53,16 @@ iobuf_init(void) for(i=0; itag = i <= (nclust/8); + c->addr = -1; c->prev = iotail; if(iotail) @@ -87,13 +97,13 @@ purgebuf(Xdata *dev) } static Ioclust* -getclust(Xdata *dev, long addr) +getclust(Xdata *dev, long addr, ulong tag) { Ioclust *c, *f; f = nil; for(c=iohead; c; c=c->next){ - if(!c->busy) + if(!c->busy && c->tag == tag) f = c; if(c->addr == addr && c->dev == dev){ c->busy++; @@ -141,13 +151,13 @@ putclust(Ioclust *c) } Iobuf* -getbuf(Xdata *dev, ulong addr) +getbuf(Xdata *dev, ulong addr, ulong tag) { int off; Ioclust *c; off = addr%BUFPERCLUST; - c = getclust(dev, addr - off); + c = getclust(dev, addr - off, tag); if(c->nbuf < off){ c->busy--; error("I/O read error");