mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reduces
gratuitous differences with ffs a little.
This commit is contained in:
parent
8adff5fc12
commit
67406320ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125739
@ -330,14 +330,15 @@ mountmsdosfs(devvp, mp, td, argp)
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
/*
|
||||
* XXX Open the device with write access even if the filesystem
|
||||
* is read-only: someone may remount it read-write later, and
|
||||
* we don't VOP_OPEN the device again in that case.
|
||||
* XXX: open the device with read and write access even if only
|
||||
* read access is needed now. Write access is needed if the
|
||||
* filesystem is ever mounted read/write, and we don't change the
|
||||
* access mode for remounts.
|
||||
*/
|
||||
#ifdef notyet
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD | FWRITE, FSCRED, td, -1);
|
||||
#else
|
||||
error = VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, FREAD | FWRITE, FSCRED, td, -1);
|
||||
#endif
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
if (error)
|
||||
@ -631,11 +632,11 @@ mountmsdosfs(devvp, mp, td, argp)
|
||||
error_exit:
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
(void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td);
|
||||
#else
|
||||
(void) VOP_CLOSE(devvp, FREAD | FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
if (pmp) {
|
||||
if (pmp->pm_inusemap)
|
||||
@ -708,11 +709,11 @@ msdosfs_unmount(mp, mntflags, td)
|
||||
VI_UNLOCK(vp);
|
||||
}
|
||||
#endif
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
error = VOP_CLOSE(pmp->pm_devvp,
|
||||
(pmp->pm_flags&MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE,
|
||||
NOCRED, td);
|
||||
(pmp->pm_flags & MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE,
|
||||
NOCRED, td);
|
||||
#else
|
||||
error = VOP_CLOSE(pmp->pm_devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
|
@ -656,14 +656,15 @@ ext2_mountfs(devvp, mp, td)
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
/*
|
||||
* XXX Open the device with write access even if the filesystem
|
||||
* is read-only: someone may remount it read-write later, and
|
||||
* we don't VOP_OPEN the device again in that case.
|
||||
* XXX: open the device with read and write access even if only
|
||||
* read access is needed now. Write access is needed if the
|
||||
* filesystem is ever mounted read/write, and we don't change the
|
||||
* access mode for remounts.
|
||||
*/
|
||||
#ifdef notyet
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD | FWRITE, FSCRED, td, -1);
|
||||
#else
|
||||
error = VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, FREAD | FWRITE, FSCRED, td, -1);
|
||||
#endif
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
if (error)
|
||||
@ -744,11 +745,11 @@ ext2_mountfs(devvp, mp, td)
|
||||
out:
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td);
|
||||
#else
|
||||
(void)VOP_CLOSE(devvp, FREAD|FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
if (ump) {
|
||||
bsd_free(ump->um_e2fs->s_es, M_EXT2MNT);
|
||||
@ -804,12 +805,12 @@ ext2_unmount(mp, mntflags, td)
|
||||
ULCK_BUF(fs->s_block_bitmap[i])
|
||||
|
||||
ump->um_devvp->v_rdev->si_mountpoint = NULL;
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE,
|
||||
NOCRED, td);
|
||||
error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD | FWRITE,
|
||||
NOCRED, td);
|
||||
#else
|
||||
error = VOP_CLOSE(ump->um_devvp, FREAD|FWRITE, NOCRED, td);
|
||||
error = VOP_CLOSE(ump->um_devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
vrele(ump->um_devvp);
|
||||
bsd_free(fs->s_es, M_EXT2MNT);
|
||||
|
@ -656,14 +656,15 @@ ext2_mountfs(devvp, mp, td)
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
/*
|
||||
* XXX Open the device with write access even if the filesystem
|
||||
* is read-only: someone may remount it read-write later, and
|
||||
* we don't VOP_OPEN the device again in that case.
|
||||
* XXX: open the device with read and write access even if only
|
||||
* read access is needed now. Write access is needed if the
|
||||
* filesystem is ever mounted read/write, and we don't change the
|
||||
* access mode for remounts.
|
||||
*/
|
||||
#ifdef notyet
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD | FWRITE, FSCRED, td, -1);
|
||||
#else
|
||||
error = VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, td, -1);
|
||||
error = VOP_OPEN(devvp, FREAD | FWRITE, FSCRED, td, -1);
|
||||
#endif
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
if (error)
|
||||
@ -744,11 +745,11 @@ ext2_mountfs(devvp, mp, td)
|
||||
out:
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td);
|
||||
#else
|
||||
(void)VOP_CLOSE(devvp, FREAD|FWRITE, NOCRED, td);
|
||||
(void)VOP_CLOSE(devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
if (ump) {
|
||||
bsd_free(ump->um_e2fs->s_es, M_EXT2MNT);
|
||||
@ -804,12 +805,12 @@ ext2_unmount(mp, mntflags, td)
|
||||
ULCK_BUF(fs->s_block_bitmap[i])
|
||||
|
||||
ump->um_devvp->v_rdev->si_mountpoint = NULL;
|
||||
/* XXX See comment at VOP_OPEN call */
|
||||
/* XXX: see comment above VOP_OPEN. */
|
||||
#ifdef notyet
|
||||
error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE,
|
||||
NOCRED, td);
|
||||
error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD | FWRITE,
|
||||
NOCRED, td);
|
||||
#else
|
||||
error = VOP_CLOSE(ump->um_devvp, FREAD|FWRITE, NOCRED, td);
|
||||
error = VOP_CLOSE(ump->um_devvp, FREAD | FWRITE, NOCRED, td);
|
||||
#endif
|
||||
vrele(ump->um_devvp);
|
||||
bsd_free(fs->s_es, M_EXT2MNT);
|
||||
|
Loading…
Reference in New Issue
Block a user