Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/msdosfs Fetch sector size also from wedges.
details: https://anonhg.NetBSD.org/src/rev/d78d982420a8
branches: trunk
changeset: 751125:d78d982420a8
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Mon Jan 25 15:30:44 2010 +0000
description:
Fetch sector size also from wedges.
diffstat:
sys/fs/msdosfs/msdosfs_vfsops.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (39 lines):
diff -r a4e44d7fa8cd -r d78d982420a8 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c Mon Jan 25 14:51:03 2010 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c Mon Jan 25 15:30:44 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.76 2009/06/29 05:08:17 dholland Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.77 2010/01/25 15:30:44 mlelstv Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.76 2009/06/29 05:08:17 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.77 2010/01/25 15:30:44 mlelstv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -501,6 +501,7 @@
psize = dpart.part->p_size;
} else {
struct dkwedge_info dkw;
+ struct disk *pdk;
error = VOP_IOCTL(devvp, DIOCGWEDGEINFO, &dkw, FREAD, NOCRED);
secsize = 512; /* XXX */
dtype = DTYPE_FLOPPY; /* XXX */
@@ -513,6 +514,12 @@
goto error_exit;
}
} else {
+ pdk = disk_find(dkw.dkw_parent);
+ if (pdk == NULL) {
+ error = ENODEV;
+ goto error_exit;
+ }
+ secsize = DEV_BSIZE << pdk->dk_blkshift;
fstype = strcmp(dkw.dkw_ptype, DKW_PTYPE_FAT) == 0 ?
FS_MSDOS : -1;
psize = dkw.dkw_size;
Home |
Main Index |
Thread Index |
Old Index