1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

ext2fs: Add some DOINGASYNC check to match ffs.

This is mostly cosmetical.

Reviewed by:	bde
MFC after:	3 days
This commit is contained in:
Pedro F. Giffuni 2013-01-18 19:11:17 +00:00
parent d177f14da9
commit b187108f66
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245612

View File

@ -180,7 +180,7 @@ ext2_truncate(vp, length, flags, cred, td)
else else
bawrite(bp); bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE; 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 * 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--) for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0; oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE; 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 * 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)); (u_int)(NINDIR(fs) - (last + 1)) * sizeof(int32_t));
if (last == -1) if (last == -1)
bp->b_flags |= B_INVAL; bp->b_flags |= B_INVAL;
error = bwrite(bp); if (DOINGASYNC(vp)) {
if (error) bdwrite(bp);
allerror = error; } else {
error = bwrite(bp);
if (error)
allerror = error;
}
bap = copy; bap = copy;
/* /*