forked from amazingfate/loongoffice
For state-less containers there is no benefit in fsync'ing, file data is safe when it is up-loaded back to storage - but profiling shows latency from stray fsyncs. Change-Id: I9f03d5866dec05e5507deb56b0dca93b6876225e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167490 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 90bd45d7a96c8c7084db13e4b6f86753db67655a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172947 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
19 lines
560 B
Diff
19 lines
560 B
Diff
--- a/nss/nss/lib/sqlite/sqlite3.c
|
|
+++ b/nss/nss/lib/sqlite/sqlite3.c
|
|
@@ -36136,6 +36136,15 @@
|
|
static int full_fsync(int fd, int fullSync, int dataOnly){
|
|
int rc;
|
|
|
|
+ static int disabledKnown = 0, disabled = 0;
|
|
+ if (!disabledKnown)
|
|
+ {
|
|
+ disabled = getenv("SAL_DISABLE_FSYNC") != NULL;
|
|
+ disabledKnown = 1;
|
|
+ }
|
|
+ if (disabled)
|
|
+ return 0;
|
|
+
|
|
/* The following "ifdef/elif/else/" block has the same structure as
|
|
** the one below. It is replicated here solely to avoid cluttering
|
|
** up the real code with the UNUSED_PARAMETER() macros.
|