Module Name:    src
Committed By:   hannken
Date:           Sat Jul 28 15:12:42 UTC 2012

Modified Files:
        src/sys/dev: fss.c

Log Message:
Use `getdisksize()' to get the size of the mounted-on block device.

Should work for disks without partition table (wedges) now.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/fss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fss.c
diff -u src/sys/dev/fss.c:1.81 src/sys/dev/fss.c:1.82
--- src/sys/dev/fss.c:1.81	Wed Nov 30 09:51:18 2011
+++ src/sys/dev/fss.c	Sat Jul 28 15:12:42 2012
@@ -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, s
     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, s
 	 * 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

Reply via email to