summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-10-21 12:14:58 +0000
committerae <ae@FreeBSD.org>2012-10-21 12:14:58 +0000
commit2ad040bf3f552fc8b740e79fe6db1bf91414d583 (patch)
treec4b4748bda44bb15b7dab09365fdddecdb576519 /sys/boot/i386
parent0435f4a49c48e7ffd3690c28630f09490ec3c2dc (diff)
downloadFreeBSD-src-2ad040bf3f552fc8b740e79fe6db1bf91414d583.zip
FreeBSD-src-2ad040bf3f552fc8b740e79fe6db1bf91414d583.tar.gz
Add the flags parameter to the disk_open() function and DISK_F_NOCACHE
flag, that disables the caching of partition tables metadata. Use this flag for floppies in the libi386/biosdisk driver.
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/libi386/biosdisk.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index 36bde12..2a71d64 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -276,7 +276,9 @@ bd_print(int verbose)
dev.d_partition = -1;
if (disk_open(&dev,
bdinfo[i].bd_sectorsize * bdinfo[i].bd_sectors,
- bdinfo[i].bd_sectorsize) == 0) {
+ bdinfo[i].bd_sectorsize,
+ (bdinfo[i].bd_flags & BD_FLOPPY) ?
+ DISK_F_NOCACHE: 0) == 0) {
sprintf(line, " disk%d", i);
disk_print(&dev, line, verbose);
disk_close(&dev);
@@ -308,7 +310,8 @@ bd_open(struct open_file *f, ...)
return (EIO);
return (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
- BD(dev).bd_sectorsize));
+ BD(dev).bd_sectorsize, (BD(dev).bd_flags & BD_FLOPPY) ?
+ DISK_F_NOCACHE: 0));
}
static int
@@ -645,7 +648,8 @@ bd_getdev(struct i386_devdesc *d)
if (biosdev == -1) /* not a BIOS device */
return(-1);
if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
- BD(dev).bd_sectorsize) != 0) /* oops, not a viable device */
+ BD(dev).bd_sectorsize,(BD(dev).bd_flags & BD_FLOPPY) ?
+ DISK_F_NOCACHE: 0) != 0) /* oops, not a viable device */
return (-1);
else
disk_close(dev);
OpenPOWER on IntegriCloud