diff options
author | tegge <tegge@FreeBSD.org> | 2006-09-26 04:20:09 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-09-26 04:20:09 +0000 |
commit | 89ea8a9b1bc6f1c756ee30736d24464f17a00879 (patch) | |
tree | a586958e0f860ed76ae21692b32b25edd0b38933 /sys | |
parent | 34ea634be74b46f8326b06761eb1e444957160ad (diff) | |
download | FreeBSD-src-89ea8a9b1bc6f1c756ee30736d24464f17a00879.zip FreeBSD-src-89ea8a9b1bc6f1c756ee30736d24464f17a00879.tar.gz |
Reduce fluctuations of mnt_flag to allow unlocked readers to get a
slightly more consistent view.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_mount.c | 12 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 543f7e4..592daf3 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -942,10 +942,9 @@ vfs_domount( * Set the mount level flags. */ MNT_ILOCK(mp); - if (fsflags & MNT_RDONLY) - mp->mnt_flag |= MNT_RDONLY; - mp->mnt_flag &=~ MNT_UPDATEMASK; - mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS); + mp->mnt_flag = (mp->mnt_flag & ~MNT_UPDATEMASK) | + (fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS | + MNT_RDONLY)); if ((mp->mnt_flag & MNT_ASYNC) == 0) mp->mnt_kern_flag &= ~MNTK_ASYNC; MNT_IUNLOCK(mp); @@ -979,11 +978,12 @@ vfs_domount( mp->mnt_optnew = NULL; if (mp->mnt_flag & MNT_UPDATE) { MNT_ILOCK(mp); - mp->mnt_flag &= - ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); if (error) mp->mnt_flag = (mp->mnt_flag & MNT_QUOTA) | (flag & ~MNT_QUOTA); + else + mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | + MNT_FORCE | MNT_SNAPSHOT); if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index b1a11be..25272f7 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1424,8 +1424,7 @@ softdep_mount(devvp, mp, fs, cred) int error, cyl; MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_ASYNC; - mp->mnt_flag |= MNT_SOFTDEP; + mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | MNTK_SOFTDEP; |