summaryrefslogtreecommitdiffstats
path: root/xlators/storage/bdb/src/bctx.c
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-04-08 04:24:22 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-08 15:04:48 +0530
commit07fcdfebf25c30811a9313ac3d9a0fdbbceaad6c (patch)
tree2650b7b7a2f93cc5530a6033b3f1426f2f6efb85 /xlators/storage/bdb/src/bctx.c
parentabf35ff6c7a2cc94d9e1e738fb76f711bd2abc16 (diff)
introduction of secondary index database in storage/bdb
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/storage/bdb/src/bctx.c')
-rw-r--r--xlators/storage/bdb/src/bctx.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/xlators/storage/bdb/src/bctx.c b/xlators/storage/bdb/src/bctx.c
index fce78e95fbb..18f563fb32c 100644
--- a/xlators/storage/bdb/src/bctx.c
+++ b/xlators/storage/bdb/src/bctx.c
@@ -75,16 +75,31 @@ bctx_table_prune (bctx_table_t *table)
list_for_each_entry_safe (del, tmp, &purge, list) {
list_del_init (&del->list);
- if (del->dbp) {
- ret = del->dbp->close (del->dbp, 0);
+ if (del->primary) {
+ ret = del->primary->close (del->primary, 0);
if (ret != 0) {
- gf_log (table->this->name, GF_LOG_ERROR,
- "failed to close db on path (%s): %s",
+ gf_log (table->this->name, GF_LOG_DEBUG,
+ "_BCTX_TABLE_PRUNE %s: %s "
+ "(failed to close primary database)",
del->directory, db_strerror (ret));
} else {
- gf_log (table->this->name, GF_LOG_WARNING,
- "close db for path %s; "
- "table->lru_count = %d",
+ gf_log (table->this->name, GF_LOG_DEBUG,
+ "_BCTX_TABLE_PRUNE %s (lru=%d)"
+ "(closed primary database)",
+ del->directory, table->lru_size);
+ }
+ }
+ if (del->secondary) {
+ ret = del->secondary->close (del->secondary, 0);
+ if (ret != 0) {
+ gf_log (table->this->name, GF_LOG_DEBUG,
+ "_BCTX_TABLE_PRUNE %s: %s "
+ "(failed to close secondary database)",
+ del->directory, db_strerror (ret));
+ } else {
+ gf_log (table->this->name, GF_LOG_DEBUG,
+ "_BCTX_TABLE_PRUNE %s (lru=%d)"
+ "(closed secondary database)",
del->directory, table->lru_size);
}
}
@@ -130,7 +145,7 @@ __hash_bctx (bctx_t *bctx)
static inline bctx_t *
__bctx_passivate (bctx_t *bctx)
{
- if (bctx->dbp) {
+ if (bctx->primary) {
list_move_tail (&bctx->list, &(bctx->table->b_lru));
bctx->table->lru_size++;
} else {