From 45097cab83e4fc4fa95e77d64f4e5b9334db70e0 Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 24 Jun 1997 00:38:46 +0000 Subject: [PATCH] foosize()'s return value is in DEV_BSIZE units; adjust the size obtained from the disklabel accordingly. --- sys/arch/arm32/dev/wd.c | 5 +++-- sys/arch/arm32/mainbus/wd.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/arch/arm32/dev/wd.c b/sys/arch/arm32/dev/wd.c index 7ddb9b5ba4ac..0a0fa381ba47 100644 --- a/sys/arch/arm32/dev/wd.c +++ b/sys/arch/arm32/dev/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.14 1997/06/18 20:43:49 pk Exp $ */ +/* $NetBSD: wd.c,v 1.15 1997/06/24 00:38:46 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -1548,7 +1548,8 @@ wdsize(dev) if (wd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP) size = -1; else - size = wd->sc_dk.dk_label->d_partitions[part].p_size; + size = wd->sc_dk.dk_label->d_partitions[part].p_size * + (wd->sc_dk.dk_label->d_secsize / DEV_BSIZE); if (omask == 0 && wdclose(dev, 0, S_IFBLK, NULL) != 0) return (-1); return (size); diff --git a/sys/arch/arm32/mainbus/wd.c b/sys/arch/arm32/mainbus/wd.c index 7ddb9b5ba4ac..0a0fa381ba47 100644 --- a/sys/arch/arm32/mainbus/wd.c +++ b/sys/arch/arm32/mainbus/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.14 1997/06/18 20:43:49 pk Exp $ */ +/* $NetBSD: wd.c,v 1.15 1997/06/24 00:38:46 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -1548,7 +1548,8 @@ wdsize(dev) if (wd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP) size = -1; else - size = wd->sc_dk.dk_label->d_partitions[part].p_size; + size = wd->sc_dk.dk_label->d_partitions[part].p_size * + (wd->sc_dk.dk_label->d_secsize / DEV_BSIZE); if (omask == 0 && wdclose(dev, 0, S_IFBLK, NULL) != 0) return (-1); return (size);