From 6f77587af5e0f8023b61cfe846578cedddb76964 Mon Sep 17 00:00:00 2001 From: semenu Date: Wed, 25 Sep 2002 23:55:06 +0000 Subject: Fix the problem introduced by vop_stdbmap() usage. The NTFS does not implement worthful VOP_BMAP() handler, so it expect the blkno not to be changed by VOP_BMAP(). Otherwise, it'll have to find some tricky way to determine if bp was VOP_BMAP()ed or not in VOP_STRATEGY(). PR: kern/42139 --- sys/fs/ntfs/ntfs_vnops.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'sys/fs/ntfs/ntfs_vnops.c') diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index d46b88b..5882602 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -75,6 +75,7 @@ static int ntfs_write(struct vop_write_args *ap); static int ntfs_getattr(struct vop_getattr_args *ap); static int ntfs_inactive(struct vop_inactive_args *ap); static int ntfs_reclaim(struct vop_reclaim_args *ap); +static int ntfs_bmap(struct vop_bmap_args *ap); static int ntfs_strategy(struct vop_strategy_args *ap); static int ntfs_access(struct vop_access_args *ap); static int ntfs_open(struct vop_open_args *ap); @@ -86,6 +87,32 @@ static int ntfs_pathconf(void *); int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */ +/* + * This is a noop, simply returning what one has been given. + */ +int +ntfs_bmap(ap) + struct vop_bmap_args /* { + struct vnode *a_vp; + daddr_t a_bn; + struct vnode **a_vpp; + daddr_t *a_bnp; + int *a_runp; + int *a_runb; + } */ *ap; +{ + dprintf(("ntfs_bmap: vn: %p, blk: %d\n", ap->a_vp,(u_int32_t)ap->a_bn)); + if (ap->a_vpp != NULL) + *ap->a_vpp = ap->a_vp; + if (ap->a_bnp != NULL) + *ap->a_bnp = ap->a_bn; + if (ap->a_runp != NULL) + *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; + return (0); +} + static int ntfs_read(ap) struct vop_read_args /* { @@ -179,7 +206,6 @@ ntfs_getattr(ap) return (0); } - /* * Last reference to an ntnode. If necessary, write or delete it. */ @@ -750,6 +776,7 @@ struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *)ntfs_readdir }, { &vop_fsync_desc, (vop_t *)ntfs_fsync }, + { &vop_bmap_desc, (vop_t *)ntfs_bmap }, { &vop_strategy_desc, (vop_t *)ntfs_strategy }, { &vop_read_desc, (vop_t *)ntfs_read }, { &vop_write_desc, (vop_t *)ntfs_write }, -- cgit v1.1