Move NTFS to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
This commit is contained in:
parent
a96d2ea768
commit
5cdfa40c6b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137041
@ -275,29 +275,9 @@ ntfs_mountfs(devvp, mp, argsp, td)
|
||||
struct buf *bp;
|
||||
struct ntfsmount *ntmp;
|
||||
struct cdev *dev = devvp->v_rdev;
|
||||
int error, ronly, ncount, i;
|
||||
int error, ronly, i;
|
||||
struct vnode *vp;
|
||||
|
||||
/*
|
||||
* Disallow multiple mounts of the same device.
|
||||
* Disallow mounting of a device that is currently in use
|
||||
* (except for root, which might share swap device for miniroot).
|
||||
* Flush out any old buffers remaining from a previous use.
|
||||
*/
|
||||
error = vfs_mountedon(devvp);
|
||||
if (error)
|
||||
return (error);
|
||||
ncount = vcount(devvp);
|
||||
if (devvp->v_object)
|
||||
ncount -= 1;
|
||||
if (ncount > 1)
|
||||
return (EBUSY);
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td, -1);
|
||||
@ -451,7 +431,6 @@ ntfs_mountfs(devvp, mp, argsp, td)
|
||||
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
|
||||
mp->mnt_maxsymlinklen = 0;
|
||||
mp->mnt_flag |= MNT_LOCAL;
|
||||
devvp->v_rdev->si_mountpoint = mp;
|
||||
return (0);
|
||||
|
||||
out1:
|
||||
@ -462,7 +441,6 @@ ntfs_mountfs(devvp, mp, argsp, td)
|
||||
dprintf(("ntfs_mountfs: vflush failed\n"));
|
||||
|
||||
out:
|
||||
devvp->v_rdev->si_mountpoint = NULL;
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
|
||||
@ -508,13 +486,6 @@ ntfs_unmount(
|
||||
if (error)
|
||||
printf("ntfs_unmount: vflush failed(sysnodes): %d\n",error);
|
||||
|
||||
/* Check if the type of device node isn't VBAD before
|
||||
* touching v_cdev. If the device vnode is revoked, the
|
||||
* field is NULL and touching it causes null pointer derefercence.
|
||||
*/
|
||||
if (ntmp->ntm_devvp->v_type != VBAD)
|
||||
ntmp->ntm_devvp->v_rdev->si_mountpoint = NULL;
|
||||
|
||||
vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, td, 0, 0);
|
||||
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
|
Loading…
Reference in New Issue
Block a user