freebsd-dev/sys/ufs/ffs
Bruce Evans 0c01bcb9ff Sprinkle DOINGASYNC() checks so as to do delayed writes for async
mounts in almost all cases instead of in most cases.  Don't override
DOINGASYNC() by any condition except IO_SYNC.

Fix previous sprinking of DOINGASYNC() checks.  Don't override IO_SYNC
by DOINGASYNC().  In ffs_write() and ffs_extwrite(), there were
intentional overrides that just broke O_SYNC of data.  In
ffs_truncate(), there are 5 calls to ffs_update(), 4 with
apparently-unintentional overrides and 1 without; this had no effect
due to the main async mount hack descibed below.

Fix 1 place in ffs_truncate() where the caller's IO_ASYNC was overridden
for the soft updates case too (to do a delayed write instead of a sync
write).  This is supposed to be the only change that affects anything
except async mounts.

In ffs_update(), remove the 19 year old efficiency hack of ignoring
the waitfor flag for async mounts, so that fsync() almost works for
async mounts.  All callers are supposed to be fixed to not ask for a
sync update unless they are for fsync() or [I]O_SYNC operations.
fsync() now almost works for async mounts.  It used to sync the data
but not the most important metdata (the inode).  It still doesn't sync
associated directories.

This gave 10-20% fewer writes for my makeworld benchmark with async
mounted tmp and obj directories from an already small number.

Style fixes:
- in ffs_balloc.c, remove rotted quadruplicated comments about the
  simplest part of the DOING*() decisions and rearrange the nearly-
  quadruplicated code to be more nearly so.
- in ufs_vnops.c, use a consistent style with less negative logic and
  no manual "optimization" of || to | in DOING*() expressions.

Reviewed by:	kib (previous version)
2016-09-08 17:40:40 +00:00
..
ffs_alloc.c
ffs_balloc.c Sprinkle DOINGASYNC() checks so as to do delayed writes for async 2016-09-08 17:40:40 +00:00
ffs_extern.h Partially lift suspension when ffs_reload() finished with cgs and 2016-09-08 12:01:28 +00:00
ffs_inode.c Sprinkle DOINGASYNC() checks so as to do delayed writes for async 2016-09-08 17:40:40 +00:00
ffs_rawread.c
ffs_snapshot.c
ffs_softdep.c Do not leak transient ENOLCK error from flush_newblk_dep() loop. 2016-09-08 12:08:54 +00:00
ffs_subr.c
ffs_suspend.c Partially lift suspension when ffs_reload() finished with cgs and 2016-09-08 12:01:28 +00:00
ffs_tables.c
ffs_vfsops.c Partially lift suspension when ffs_reload() finished with cgs and 2016-09-08 12:01:28 +00:00
ffs_vnops.c Sprinkle DOINGASYNC() checks so as to do delayed writes for async 2016-09-08 17:40:40 +00:00
fs.h Renumber the advertising clause. 2016-09-06 15:17:35 +00:00
softdep.h Bug 211013 reports that a write error to a UFS filesystem running 2016-08-16 21:02:30 +00:00