summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.c8
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.h6
-rw-r--r--xlators/cluster/dht/src/tier.c5
-rw-r--r--xlators/cluster/dht/src/tier.h1
4 files changed, 16 insertions, 4 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.c b/libglusterfs/src/gfdb/gfdb_data_store.c
index 9ea9150f3c3..e409e0ddc69 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.c
+++ b/libglusterfs/src/gfdb/gfdb_data_store.c
@@ -712,6 +712,12 @@ clear_files_heat (gfdb_conn_node_t *_conn_node) {
return ret;
}
+static const
+char *get_db_path_key()
+{
+ return GFDB_SQL_PARAM_DBPATH;
+}
+
void get_gfdb_methods (gfdb_methods_t *methods)
{
methods->init_db = init_db;
@@ -720,4 +726,6 @@ void get_gfdb_methods (gfdb_methods_t *methods)
methods->find_recently_changed_files = find_recently_changed_files;
methods->find_unchanged_for_time_freq = find_unchanged_for_time_freq;
methods->find_recently_changed_files_freq = find_recently_changed_files_freq;
+ methods->get_db_path_key = get_db_path_key;
}
+
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.h b/libglusterfs/src/gfdb/gfdb_data_store.h
index 5e46162b1ea..6a7ddcf7212 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store.h
@@ -236,7 +236,8 @@ typedef int (*find_recently_changed_files_freq_t) (gfdb_conn_node_t *_conn_node,
int read_freq_thresold,
gf_boolean_t _clear_counters);
-
+typedef const
+char *(*get_db_path_key_t)();
/*Libgfdb API Function: Clear the heat for all the files
*
@@ -256,7 +257,10 @@ typedef struct gfdb_methods_s {
find_recently_changed_files_t find_recently_changed_files;
find_unchanged_for_time_freq_t find_unchanged_for_time_freq;
find_recently_changed_files_freq_t find_recently_changed_files_freq;
+ /* Do not expose dbpath directly. Expose it via an */
+ /* access function: get_db_path_key(). */
char *dbpath;
+ get_db_path_key_t get_db_path_key;
} gfdb_methods_t;
void get_gfdb_methods (gfdb_methods_t *methods);
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index ff31c17c7e2..c86eb4f5514 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -470,8 +470,9 @@ tier_process_brick_cbk (brick_list_t *local_brick, void *args) {
"DB Params cannot initialized!");
goto out;
}
- SET_DB_PARAM_TO_DICT(this->name, params_dict, GFDB_SQL_PARAM_DBPATH,
- db_path, ret, out);
+ SET_DB_PARAM_TO_DICT(this->name, params_dict,
+ (char *) gfdb_methods.get_db_path_key(),
+ db_path, ret, out);
/*Get the db connection*/
conn_node = gfdb_methods.init_db((void *)params_dict, dht_tier_db_type);
diff --git a/xlators/cluster/dht/src/tier.h b/xlators/cluster/dht/src/tier.h
index 76ff27d5932..d168221fe1d 100644
--- a/xlators/cluster/dht/src/tier.h
+++ b/xlators/cluster/dht/src/tier.h
@@ -31,7 +31,6 @@
#define TIMER_SECS 3600
#include "gfdb_data_store.h"
-#include "gfdb_sqlite3.h"
#include <ctype.h>
#include <sys/stat.h>