summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_inode.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>1999-07-13 18:20:13 +0000
committermckusick <mckusick@FreeBSD.org>1999-07-13 18:20:13 +0000
commitf091c51c34a496d3062026be39d6948fa02b6c6e (patch)
tree7cab0e079bf7fb1610e4cb41564952dc7ee44c83 /sys/ufs/ffs/ffs_inode.c
parent514e7c3963e88bf59518e2ba852c20fe7ca68df4 (diff)
downloadFreeBSD-src-f091c51c34a496d3062026be39d6948fa02b6c6e.zip
FreeBSD-src-f091c51c34a496d3062026be39d6948fa02b6c6e.tar.gz
Create the macro DOINGASYNC to check whether the MNT_ASYNC flag has
been set for a mount point. Insert missing checks to ensure that all write operations are done asynchronously when the MNT_ASYNC option has been requested. Submitted by: Craig A Soules <soules+@andrew.cmu.edu> Reviewed by: Kirk McKusick <mckusick@mckusick.com>
Diffstat (limited to 'sys/ufs/ffs/ffs_inode.c')
-rw-r--r--sys/ufs/ffs/ffs_inode.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index c80d0a5..0895173 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
- * $Id: ffs_inode.c,v 1.53 1999/01/28 00:57:54 dillon Exp $
+ * $Id: ffs_inode.c,v 1.54 1999/05/02 23:56:48 alc Exp $
*/
#include "opt_quota.h"
@@ -107,7 +107,7 @@ ffs_update(vp, waitfor)
panic("ffs_update: bad link cnt");
*((struct dinode *)bp->b_data +
ino_to_fsbo(fs, ip->i_number)) = ip->i_din;
- if (waitfor && (vp->v_mount->mnt_flag & MNT_ASYNC) == 0) {
+ if (waitfor && !DOINGASYNC(vp)) {
return (bwrite(bp));
} else {
if (bp->b_bufsize == fs->fs_bsize)
@@ -218,8 +218,6 @@ ffs_truncate(vp, length, flags, cred, p)
bp->b_flags |= B_CLUSTEROK;
if (aflags & B_SYNC)
bwrite(bp);
- else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
- bdwrite(bp);
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -256,8 +254,6 @@ ffs_truncate(vp, length, flags, cred, p)
bp->b_flags |= B_CLUSTEROK;
if (aflags & B_SYNC)
bwrite(bp);
- else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
- bdwrite(bp);
else
bawrite(bp);
}
@@ -472,12 +468,12 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->fs_bsize);
bzero((caddr_t)&bap[last + 1],
(u_int)(NINDIR(fs) - (last + 1)) * sizeof (ufs_daddr_t));
- if ((vp->v_mount->mnt_flag & MNT_ASYNC) == 0) {
+ if (DOINGASYNC(vp)) {
+ bawrite(bp);
+ } else {
error = bwrite(bp);
if (error)
allerror = error;
- } else {
- bawrite(bp);
}
bap = copy;
}
OpenPOWER on IntegriCloud