sqlite: add option to disable fsync
authorFloris Bos <bos@je-eigen-domein.nl>
Thu, 11 Sep 2014 15:43:32 +0000 (17:43 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 13 Sep 2014 21:51:59 +0000 (23:51 +0200)
For use-cases in which performance is more important than data integrity.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/sqlite/Config.in
package/sqlite/sqlite.mk

index fe6cc089676c560ba6f22f3d3271540380da967f..7ea9eb15b8ab68f67f3af71c6002ecc3e28665ab 100644 (file)
@@ -53,4 +53,13 @@ config BR2_PACKAGE_SQLITE_SECURE_DELETE
          http://www.sqlite.org/pragma.html#pragma_secure_delete
          for additional information.
 
+config BR2_PACKAGE_SQLITE_NO_SYNC
+       bool "Disable fsync"
+       help
+         By default SQLite forces all database transactions to storage
+         immediately using fsync() to protect against data loss in case
+         of power failure.
+         This option turns this behavior off resulting in higher performance
+         especially when using slow flash storage.
+
 endif
index e30b7109b323421f7dd3f8eaacd643a2b3e29a1f..d960ce8424c15e3bdcb033a4420a3584cdd2cd16 100644 (file)
@@ -33,6 +33,10 @@ ifeq ($(BR2_PACKAGE_SQLITE_SECURE_DELETE),y)
 SQLITE_CFLAGS += -DSQLITE_SECURE_DELETE
 endif
 
+ifeq ($(BR2_PACKAGE_SQLITE_NO_SYNC),y)
+SQLITE_CFLAGS += -DSQLITE_NO_SYNC
+endif
+
 SQLITE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) $(SQLITE_CFLAGS)"
 
 SQLITE_CONF_OPT = \