summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorhannken <hannken@NetBSD.org>2012-07-28 15:12:42 +0000
committerhannken <hannken@NetBSD.org>2012-07-28 15:12:42 +0000
commit20f6b6f8dc3caf86104679a2acfebbcecd47fd93 (patch)
treec08a3af1cee791c5deb4e5b91539163ad8a12722 /sys/dev
parent60f15b85ba9c1e2c1087534ed41117e343c9b7ba (diff)
Use `getdisksize()' to get the size of the mounted-on block device.
Should work for disks without partition table (wedges) now.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fss.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/fss.c b/sys/dev/fss.c
index 29f2c991f58..1bb1ee90482 100644
--- a/sys/dev/fss.c
+++ b/sys/dev/fss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fss.c,v 1.81 2011/11/30 09:51:18 bouyer Exp $ */
+/* $NetBSD: fss.c,v 1.82 2012/07/28 15:12:42 hannken Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.81 2011/11/30 09:51:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.82 2012/07/28 15:12:42 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -622,8 +622,9 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss,
off_t *bsize, struct lwp *l)
{
int error, bits, fsbsize;
+ uint64_t numsec;
+ unsigned int secsize;
struct timespec ts;
- struct partinfo dpart;
/* nd -> nd2 to reduce mistakes while updating only some namei calls */
struct pathbuf *pb2;
struct nameidata nd2;
@@ -711,11 +712,11 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss,
* Get the block device size.
*/
- error = bdev_ioctl(sc->sc_bdev, DIOCGPART, &dpart, FREAD, l);
+ error = getdisksize(vp, &numsec, &secsize);
if (error)
return error;
- *bsize = (off_t)dpart.disklab->d_secsize*dpart.part->p_size;
+ *bsize = (off_t)numsec*secsize;
/*
* Get the backing store