From fbc9fa50595f3f6abc414d72e04650de45db3d9e Mon Sep 17 00:00:00 2001 From: "Daniel C. Sobral" Date: Wed, 15 Mar 2000 01:53:34 +0000 Subject: [PATCH] Pass unit number to bcache_strategy(), so that the cache can be flushed if the unit changes. Compute the absolute offset before bcache_strategy() instead of after. The actual fix is sligthly different for the one in the PR. PR: 17098 Submitted by: John Hood --- sys/boot/alpha/libalpha/srmdisk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c index 516bba4670c..03cb49deee8 100644 --- a/sys/boot/alpha/libalpha/srmdisk.c +++ b/sys/boot/alpha/libalpha/srmdisk.c @@ -332,10 +332,11 @@ static int bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize) { struct bcache_devdata bcd; + struct open_disk *od = (struct open_disk *)devdata; bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; - return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize)); + return(bcache_strategy(&bcd, od->od_unit, rw, dblk + od->od_boff, size, buf, rsize)); } static int @@ -353,7 +354,7 @@ bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, s if (rsize) *rsize = 0; - ret.bits = prom_read(od->od_fd, size, buf, dblk + od->od_boff); + ret.bits = prom_read(od->od_fd, size, buf, dblk); if (ret.u.status) { D(printf("read error\n")); return (EIO);