From 2b37b49e2c7c15e146a64b6c209e549ad8517555 Mon Sep 17 00:00:00 2001 From: pfg Date: Fri, 18 Jan 2013 19:11:17 +0000 Subject: [PATCH] ext2fs: Add some DOINGASYNC check to match ffs. This is mostly cosmetical. Reviewed by: bde MFC after: 3 days --- sys/fs/ext2fs/ext2_inode.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/fs/ext2fs/ext2_inode.c b/sys/fs/ext2fs/ext2_inode.c index e7fc9a873e47..6e823b211525 100644 --- a/sys/fs/ext2fs/ext2_inode.c +++ b/sys/fs/ext2fs/ext2_inode.c @@ -180,7 +180,7 @@ ext2_truncate(vp, length, flags, cred, td) else bawrite(bp); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (ext2_update(ovp, 1)); + return (ext2_update(ovp, !DOINGASYNC(ovp))); } /* * Shorten the size of the file. If the file is not being @@ -238,7 +238,7 @@ ext2_truncate(vp, length, flags, cred, td) for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - allerror = ext2_update(ovp, 1); + allerror = ext2_update(ovp, !DOINGASYNC(ovp)); /* * Having written the new inode to disk, save its new configuration @@ -420,9 +420,13 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp) (u_int)(NINDIR(fs) - (last + 1)) * sizeof(int32_t)); if (last == -1) bp->b_flags |= B_INVAL; - error = bwrite(bp); - if (error) - allerror = error; + if (DOINGASYNC(vp)) { + bdwrite(bp); + } else { + error = bwrite(bp); + if (error) + allerror = error; + } bap = copy; /*