summaryrefslogtreecommitdiffstats
path: root/sys/fs/ntfs/ntfs_vnops.c
diff options
context:
space:
mode:
authorpeadar <peadar@FreeBSD.org>2005-01-27 13:50:27 +0000
committerpeadar <peadar@FreeBSD.org>2005-01-27 13:50:27 +0000
commit80f3d1cb457b8b12ec5b66dc0878a60229d7e187 (patch)
treeaa8b5b038efa85d8a818ccc6e683307ae0d531f4 /sys/fs/ntfs/ntfs_vnops.c
parente0ac0a48cd5f9e54521f1dc133f9fc10bee873fc (diff)
downloadFreeBSD-src-80f3d1cb457b8b12ec5b66dc0878a60229d7e187.zip
FreeBSD-src-80f3d1cb457b8b12ec5b66dc0878a60229d7e187.tar.gz
Make NTFS at least minimally usable after bufobj and GEOM fallout.
mmap() on NTFS files was hosed, returning pages offset from the start of the disk rather than the start of the file. (ie, "cp" of a 1-block file would get you a copy of the boot sector, not the data in the file.) The solution isn't ideal, but gives a functioning filesystem. Cached vnode lookup was also broken, resulting in vnode haemorrhage. A lookup on the same file twice would give you two vnodes, and the resulting cached pages. Just recently, mmap() was broken due to a lack of a call to vnode_create_vobject() in ntfs_open(). Discussed with: phk@
Diffstat (limited to 'sys/fs/ntfs/ntfs_vnops.c')
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index 4cc466d..e928325 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -98,13 +98,10 @@ ntfs_bmap(ap)
} */ *ap;
{
struct vnode *vp = ap->a_vp;
- struct fnode *fp = VTOF(vp);
- struct ntnode *ip = FTONT(fp);
- struct ntfsmount *ntmp = ip->i_mp;
dprintf(("ntfs_bmap: vn: %p, blk: %d\n", ap->a_vp,(u_int32_t)ap->a_bn));
if (ap->a_bop != NULL)
- *ap->a_bop = &ntmp->ntm_devvp->v_bufobj;
+ *ap->a_bop = &vp->v_bufobj;
if (ap->a_bnp != NULL)
*ap->a_bnp = ap->a_bn;
if (ap->a_runp != NULL)
@@ -445,6 +442,8 @@ ntfs_open(ap)
printf("ntfs_open: %d\n",ip->i_number);
#endif
+ vnode_create_vobject(ap->a_vp, VTOF(ap->a_vp)->f_size, ap->a_td);
+
/*
* Files marked append-only must be opened for appending.
*/
OpenPOWER on IntegriCloud