Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/hfs use getdisksize()



details:   https://anonhg.NetBSD.org/src/rev/4ec8af5f472f
branches:  trunk
changeset: 771198:4ec8af5f472f
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 13 23:03:55 2011 +0000

description:
use getdisksize()

diffstat:

 sys/fs/hfs/hfs_subr.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r 53ab3dc9e114 -r 4ec8af5f472f sys/fs/hfs/hfs_subr.c
--- a/sys/fs/hfs/hfs_subr.c     Sun Nov 13 23:03:24 2011 +0000
+++ b/sys/fs/hfs/hfs_subr.c     Sun Nov 13 23:03:55 2011 +0000
@@ -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 @@
 #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_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 @@
        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;
 



Home | Main Index | Thread Index | Old Index