Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dkwedge Make wedges aware of underlying physical blo...



details:   https://anonhg.NetBSD.org/src/rev/9a7ab203a8f5
branches:  trunk
changeset: 759995:9a7ab203a8f5
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Dec 23 14:22:03 2010 +0000

description:
Make wedges aware of underlying physical block size.

diffstat:

 sys/dev/dkwedge/dk.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 2f0c45600c20 -r 9a7ab203a8f5 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Thu Dec 23 13:34:46 2010 +0000
+++ b/sys/dev/dkwedge/dk.c      Thu Dec 23 14:22:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.57 2010/08/04 12:34:00 bouyer Exp $   */
+/*     $NetBSD: dk.c,v 1.58 2010/12/23 14:22:03 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.57 2010/08/04 12:34:00 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.58 2010/12/23 14:22:03 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -235,10 +235,11 @@
 
        geom = prop_dictionary_create();
 
-       prop_dictionary_set_uint64(geom, "sectors-per-unit", dkw->dkw_size);
+       prop_dictionary_set_uint64(geom, "sectors-per-unit",
+           dkw->dkw_size >> disk->dk_blkshift);
 
        prop_dictionary_set_uint32(geom, "sector-size",
-           DEV_BSIZE /* XXX 512? */);
+           DEV_BSIZE << disk->dk_blkshift);
 
        prop_dictionary_set_uint32(geom, "sectors-per-track", 32);
 
@@ -432,6 +433,7 @@
         */
 
        disk_init(&sc->sc_dk, device_xname(sc->sc_dev), NULL);
+       disk_blocksize(&sc->sc_dk, DEV_BSIZE << pdk->dk_blkshift);
        dkgetproperties(&sc->sc_dk, dkw);
        disk_attach(&sc->sc_dk);
 



Home | Main Index | Thread Index | Old Index