Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Handle sector sizes other than DEV_BSIZE when readi...
details: https://anonhg.NetBSD.org/src/rev/3dc50cda9be7
branches: trunk
changeset: 341904:3dc50cda9be7
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sat Nov 28 14:36:00 2015 +0000
description:
Handle sector sizes other than DEV_BSIZE when reading labels.
diffstat:
sys/kern/subr_disk.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 290a93d04273 -r 3dc50cda9be7 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c Sat Nov 28 14:20:32 2015 +0000
+++ b/sys/kern/subr_disk.c Sat Nov 28 14:36:00 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $ */
+/* $NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -421,7 +421,7 @@
disk_read_sectors(void (*strat)(struct buf *), const struct disklabel *lp,
struct buf *bp, unsigned int sector, int count)
{
- bp->b_blkno = sector;
+ bp->b_blkno = btodb((off_t)sector * lp->d_secsize);
bp->b_bcount = count * lp->d_secsize;
bp->b_flags = (bp->b_flags & ~B_WRITE) | B_READ;
bp->b_oflags &= ~BO_DONE;
Home |
Main Index |
Thread Index |
Old Index