summaryrefslogtreecommitdiffstats
path: root/xlators/storage/bdb/src/bctx.c
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-04-08 04:24:00 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-08 15:04:02 +0530
commitabf35ff6c7a2cc94d9e1e738fb76f711bd2abc16 (patch)
treeca60920681094b2fa10ee04570df174a17afe1dc /xlators/storage/bdb/src/bctx.c
parent8fea700263bd356e6ecacd3dabc9a9c00043a804 (diff)
link() & rename() on storage/bdb will always return EXDEV.
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.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/xlators/storage/bdb/src/bctx.c b/xlators/storage/bdb/src/bctx.c
index 7fc47cd7b72..fce78e95fbb 100644
--- a/xlators/storage/bdb/src/bctx.c
+++ b/xlators/storage/bdb/src/bctx.c
@@ -324,76 +324,3 @@ out:
free (pathname);
return bctx;
}
-
-inline int32_t
-bdb_db_rename (bctx_table_t *table,
- const char *oldpath,
- const char *newpath)
-{
- DB_ENV *dbenv = NULL;
- int32_t ret = -1;
-
- GF_VALIDATE_OR_GOTO ("bctx", table, out);
- GF_VALIDATE_OR_GOTO ("bctx", oldpath, out);
- GF_VALIDATE_OR_GOTO ("bctx", newpath, out);
-
- dbenv = table->dbenv;
- GF_VALIDATE_OR_GOTO ("bctx", dbenv, out);
-
- LOCK (&table->lock);
- {
- ret = dbenv->dbrename (dbenv, NULL, oldpath, NULL, newpath, 0);
-
- if (ret != 0) {
- gf_log ("bctx", GF_LOG_ERROR,
- "failed to rename %s to %s: %s",
- oldpath, newpath, db_strerror (ret));
- } else {
- gf_log ("bctx", GF_LOG_DEBUG,
- "successfully renamed %s to %s: %s",
- oldpath, newpath, db_strerror (ret));
- }
- }
- UNLOCK (&table->lock);
-
-out:
- return ret;
-}
-
-bctx_t *
-bctx_rename (bctx_t *bctx,
- const char *db_newpath)
-{
- bctx_table_t *table = NULL;
- int32_t ret = -1;
-
- table = bctx->table;
-
- LOCK (&table->lock);
- {
- __unhash_bctx (bctx);
- list_del_init (&bctx->list);
- if (bctx->dbp) {
- ret = bctx->dbp->close (bctx->dbp, 0);
- if (ret != 0) {
- gf_log ("bdb-ll", GF_LOG_ERROR,
- "failed to close db for "
- "directory %s (%s)",
- bctx->directory, db_strerror (ret));
- }
- bctx->dbp = NULL;
- }
- }
- UNLOCK (&table->lock);
-
- ret = bdb_db_rename (table, bctx->db_path, db_newpath);
-
- if (ret != 0) {
- gf_log ("bctx", GF_LOG_ERROR,
- "bdb_db_rename failed for directory %s",
- bctx->directory);
- bctx = NULL;
- }
-
- return bctx;
-}