rpm/dbfsync.diff

55 lines
1.6 KiB
Diff
Raw Normal View History

Support a database-local fsync setting. Needs berkeley db patch.
Index: lib/backend/db3.c
===================================================================
--- lib/backend/db3.c.orig
+++ lib/backend/db3.c
@@ -191,10 +191,12 @@ static int db_fini(dbiIndex dbi, const c
return rc;
}
+#if 0
static int db3_fsync_disable(int fd)
{
return 0;
}
+#endif
#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 5)
/*
@@ -357,10 +359,12 @@ static int db_init(dbiIndex dbi, const c
/* dbenv->set_rep_transport(???) */
/* dbenv->set_rep_limit(???) */
+#if 0
if (dbi->dbi_no_fsync) {
xx = db_env_set_func_fsync(db3_fsync_disable);
xx = cvtdberr(dbi, "db_env_set_func_fsync", xx, _debug);
}
+#endif
if (dbi->dbi_shmkey) {
xx = dbenv->set_shm_key(dbenv, dbi->dbi_shmkey);
Index: lib/backend/dbconfig.c
===================================================================
--- lib/backend/dbconfig.c.orig
+++ lib/backend/dbconfig.c
@@ -94,6 +94,8 @@ struct poptOption rdbOptions[] = {
NULL, NULL },
{ "fcntl_locking",0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_FCNTL_LOCKING,
NULL, NULL },
+ { "nofsync", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_NOFSYNC,
+ NULL, NULL },
{ "btree", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_BTREE,
NULL, NULL },
@@ -140,8 +142,6 @@ struct poptOption rdbOptions[] = {
NULL, NULL },
{ "usedbenv", 0,POPT_ARG_NONE, &db3dbi.dbi_use_dbenv, 0,
NULL, NULL },
- { "nofsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_fsync, 0,
- NULL, NULL },
{ "nodbsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_dbsync, 0,
NULL, NULL },
{ "lockdbfd", 0,POPT_ARG_NONE, &db3dbi.dbi_lockdbfd, 0,