From ea0665cd2b193f28e09748354d2bbd760b3530c0 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sun, 1 Mar 1998 21:26:09 +0000 Subject: [PATCH] Fix mmap() on msdosfs. In the words of the submitter: |In the process of evaluating the getpages/putpages issues I discovered |that mmap on MSDOSFS does not work. This is because I blindly merged |NetBSD changes in msdosfs_bmap and msdosfs_strategy. Apparently, their |blocksize is always DEV_BSIZE (even in files), while in FreeBSD |blocksize in files is v_mount->mnt_stat.f_iosize (i.e. clustersize in |MSDOSFS case). The patch is below. Submitted by: Dmitrij Tejblum --- sys/fs/msdosfs/msdosfs_vnops.c | 7 +++---- sys/msdosfs/msdosfs_vnops.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 8823d0d953b7..e92b24bf55ec 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.61 1998/02/24 14:13:16 ache Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.62 1998/02/26 06:45:46 msmith Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -1834,7 +1834,7 @@ msdosfs_bmap(ap) if (ap->a_runb) { *ap->a_runb = 0; } - return (pcbmap(dep, de_bn2cn(pmp, ap->a_bn), ap->a_bnp, 0, 0)); + return (pcbmap(dep, ap->a_bn, ap->a_bnp, 0, 0)); } static int @@ -1857,8 +1857,7 @@ msdosfs_strategy(ap) * don't allow files with holes, so we shouldn't ever see this. */ if (bp->b_blkno == bp->b_lblkno) { - error = pcbmap(dep, de_bn2cn(dep->de_pmp, bp->b_lblkno), - &bp->b_blkno, 0, 0); + error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, 0, 0); if (error) { bp->b_error = error; bp->b_flags |= B_ERROR; diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 8823d0d953b7..e92b24bf55ec 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.61 1998/02/24 14:13:16 ache Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.62 1998/02/26 06:45:46 msmith Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -1834,7 +1834,7 @@ msdosfs_bmap(ap) if (ap->a_runb) { *ap->a_runb = 0; } - return (pcbmap(dep, de_bn2cn(pmp, ap->a_bn), ap->a_bnp, 0, 0)); + return (pcbmap(dep, ap->a_bn, ap->a_bnp, 0, 0)); } static int @@ -1857,8 +1857,7 @@ msdosfs_strategy(ap) * don't allow files with holes, so we shouldn't ever see this. */ if (bp->b_blkno == bp->b_lblkno) { - error = pcbmap(dep, de_bn2cn(dep->de_pmp, bp->b_lblkno), - &bp->b_blkno, 0, 0); + error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, 0, 0); if (error) { bp->b_error = error; bp->b_flags |= B_ERROR;