diff options
author | dcs <dcs@FreeBSD.org> | 2000-03-15 01:53:34 +0000 |
---|---|---|
committer | dcs <dcs@FreeBSD.org> | 2000-03-15 01:53:34 +0000 |
commit | 0edaa7aeae6d265b624f2d3ce4945a29c4e13d7d (patch) | |
tree | ae974576fefd6e2983c12a08938e7b9ad577270a /sys | |
parent | a31736f3560a56971f56d17af132971cb1f7d1e3 (diff) | |
download | FreeBSD-src-0edaa7aeae6d265b624f2d3ce4945a29c4e13d7d.zip FreeBSD-src-0edaa7aeae6d265b624f2d3ce4945a29c4e13d7d.tar.gz |
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 <jhood@sitaranetworks.com>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/alpha/libalpha/srmdisk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c index 516bba4..03cb49d 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); |