summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rebalance.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 9f389c12213..98d9b58385d 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1985,6 +1985,22 @@ gf_defrag_start_crawl (void *data)
goto out;
}
methods->migration_other(this, defrag);
+ if (defrag->cmd == GF_DEFRAG_CMD_START_DETACH_TIER) {
+ migrate_data = dict_new ();
+ if (!migrate_data) {
+ ret = -1;
+ goto out;
+ }
+ ret = dict_set_str (migrate_data,
+ GF_XATTR_FILE_MIGRATE_KEY,
+ "force");
+ if (ret)
+ goto out;
+
+ ret = gf_defrag_fix_layout (this, defrag, &loc,
+ fix_layout,
+ migrate_data);
+ }
}
if ((defrag->defrag_status != GF_DEFRAG_STATUS_STOPPED) &&
@@ -2173,6 +2189,14 @@ out:
}
int
+gf_defrag_start_detach_tier (gf_defrag_info_t *defrag)
+{
+ defrag->cmd = GF_DEFRAG_CMD_START_DETACH_TIER;
+
+ return 0;
+}
+
+int
gf_defrag_stop (gf_defrag_info_t *defrag, gf_defrag_status_t status,
dict_t *output)
{