mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
ffs: Support O_DSYNC.
Respect the new IO_DATASYNC flag when performing synchronous writes. Compared to O_SYNC, O_DSYNC lets us skip updating the inode in some cases, matching the behaviour of fdatasync(2). Reviewed by: kib Differential Review: https://reviews.freebsd.org/D25160
This commit is contained in:
1 parent
a5e284038e
commit
e7347be9e3
1 file changed
+3
-1
@@ -1001,7 +1001,9 @@ ffs_write(ap)
|
||||
uio->uio_resid = resid;
|
||||
}
|
||||
} else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
|
||||
error = ffs_update(vp, 1);
|
||||
if (!(ioflag & IO_DATASYNC) ||
|
||||
(ip->i_flags & (IN_SIZEMOD | IN_IBLKDATA)))
|
||||
error = ffs_update(vp, 1);
|
||||
if (ffs_fsfail_cleanup(VFSTOUFS(vp->v_mount), error))
|
||||
error = ENXIO;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user