From 67406320ff7f17aa017f1c26fe748edf04174e3b Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Thu, 12 Feb 2004 17:54:58 +0000 Subject: MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reduces gratuitous differences with ffs a little. --- sys/fs/msdosfs/msdosfs_vfsops.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'sys/fs') diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 0b21bc1b2c10..12dd65c7200a 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -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 -- cgit v1.2.3