Module Name:    src
Committed By:   christos
Date:           Sun Nov 13 23:09:58 UTC 2011

Modified Files:
        src/sys/fs/v7fs: v7fs_vfsops.c

Log Message:
use getdisksize()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/v7fs/v7fs_vfsops.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/v7fs/v7fs_vfsops.c
diff -u src/sys/fs/v7fs/v7fs_vfsops.c:1.4 src/sys/fs/v7fs/v7fs_vfsops.c:1.5
--- src/sys/fs/v7fs/v7fs_vfsops.c:1.4	Fri Jul 29 23:53:18 2011
+++ src/sys/fs/v7fs/v7fs_vfsops.c	Sun Nov 13 18:09:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs_vfsops.c,v 1.4 2011/07/30 03:53:18 uch Exp $	*/
+/*	$NetBSD: v7fs_vfsops.c,v 1.5 2011/11/13 23:09:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.4 2011/07/30 03:53:18 uch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.5 2011/11/13 23:09:58 christos Exp $");
 #if defined _KERNEL_OPT
 #include "opt_v7fs.h"
 #endif
@@ -42,7 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.
 #include <sys/time.h>
 #include <sys/ucred.h>
 #include <sys/mount.h>
-#include <sys/disklabel.h>
+#include <sys/disk.h>
+#include <sys/device.h>
 #include <sys/fcntl.h>
 #include <sys/malloc.h>
 #include <sys/kauth.h>
@@ -189,17 +190,16 @@ v7fs_mount(struct mount *mp, const char 
 static int
 is_v7fs_partition(struct vnode *devvp)
 {
-	struct partinfo dpart;
+	struct dkwedge_info dkw;
 	int error;
 
-	if ((error = VOP_IOCTL(devvp, DIOCGPART, &dpart, FREAD, NOCRED)) != 0) {
-		DPRINTF("VOP_IOCTL=%d\n", error);
+	if ((error = getdiskinfo(devvp, &dkw)) != 0) {
+		DPRINTF("getdiskinfo=%d\n", error);
 		return error;
 	}
-	DPRINTF("fstype=%d dtype=%d bsize=%d\n", dpart.part->p_fstype,
-	    dpart.disklab->d_type, dpart.disklab->d_secsize);
+	DPRINTF("ptype=%s size=%" PRIu64 "\n", dkw.dkw_ptype, dkw->dkw_size);
 
-	return (dpart.part->p_fstype == FS_V7) ? 0 : EINVAL;
+	return strcmp(dkw.dkw_ptype, DKW_PTYPE_V7) == 0 ? 0 : EINVAL;
 }
 
 static int

Reply via email to