Module Name: src Committed By: christos Date: Sun Nov 13 23:03:55 UTC 2011
Modified Files: src/sys/fs/hfs: hfs_subr.c Log Message: use getdisksize() To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/fs/hfs/hfs_subr.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/fs/hfs/hfs_subr.c diff -u src/sys/fs/hfs/hfs_subr.c:1.15 src/sys/fs/hfs/hfs_subr.c:1.16 --- src/sys/fs/hfs/hfs_subr.c:1.15 Thu Feb 24 18:48:59 2011 +++ src/sys/fs/hfs/hfs_subr.c Sun Nov 13 18:03:55 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hfs_subr.c,v 1.15 2011/02/24 23:48:59 christos Exp $ */ +/* $NetBSD: hfs_subr.c,v 1.16 2011/11/13 23:03:55 christos Exp $ */ /*- * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hfs_subr.c,v 1.15 2011/02/24 23:48:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hfs_subr.c,v 1.16 2011/11/13 23:03:55 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -43,7 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: hfs_subr.c,v #include <sys/file.h> #include <sys/filedesc.h> #include <sys/mount.h> -#include <sys/disklabel.h> +#include <sys/device.h> #include <sys/conf.h> #include <sys/kauth.h> #include <sys/buf.h> @@ -155,8 +155,9 @@ hfs_libcb_opendev( { hfs_libcb_data* cbdata = NULL; hfs_libcb_argsopen* args; - struct partinfo dpart; int result, mode; + uint64_t psize; + unsigned secsize; result = 0; args = (hfs_libcb_argsopen*)(cbargs->openvol); @@ -193,11 +194,10 @@ hfs_libcb_opendev( cbdata->devvp = args->devvp; /* Determine the device's block size. Default to DEV_BSIZE if unavailable.*/ - if (VOP_IOCTL(args->devvp, DIOCGPART, &dpart, FREAD, args->cred) - != 0) + if (getdisksize(args->devvp, &psize, &secsize) != 0) cbdata->devblksz = DEV_BSIZE; else - cbdata->devblksz = dpart.disklab->d_secsize; + cbdata->devblksz = secsize; return 0;