summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/tier.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/tier.c')
-rw-r--r--xlators/cluster/dht/src/tier.c46
1 files changed, 5 insertions, 41 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 6a9bddfc179..dbb34c67620 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -12,6 +12,7 @@
#include "dht-common.h"
#include "tier.h"
+#include "tier-common.h"
#include "syscall.h"
/*Hard coded DB info*/
@@ -442,7 +443,7 @@ tier_migrate_using_query_file (void *_args)
goto abort;
}
- gf_msg_trace (this->name, 0,
+ gf_msg_debug (this->name, 0,
"Tier %d"
" src_subvol %s file %s",
query_cbk_args->is_promotion,
@@ -1557,53 +1558,16 @@ xlator_t *
tier_search (xlator_t *this, dht_layout_t *layout, const char *name)
{
xlator_t *subvol = NULL;
- void *value;
- int search_subvol = 0;
dht_conf_t *conf = NULL;
- gf_defrag_info_t *defrag = NULL;
- int layout_cold = 0;
- int layout_hot = 1;
GF_VALIDATE_OR_GOTO ("tier", this, out);
- GF_VALIDATE_OR_GOTO (this->name, layout, out);
- GF_VALIDATE_OR_GOTO (this->name, name, out);
GF_VALIDATE_OR_GOTO (this->name, this->private, out);
conf = this->private;
- /* The first subvolume in the graph is always cold. */
- /* Find the position of the cold subvolume in the layout. */
- layout_cold = 0;
- layout_hot = 1;
- if (conf->subvolumes[0] != layout->list[0].xlator) {
- layout_cold = 1;
- layout_hot = 0;
- }
-
- search_subvol = layout_hot;
-
- defrag = conf->defrag;
- if (defrag && defrag->cmd == GF_DEFRAG_CMD_START_DETACH_TIER)
- search_subvol = layout_cold;
-
- /* "decommission_subvols_cnt" can only be non-zero on detach. */
- /* This will change once brick add/remove is supported for */
- /* tiered volumes. */
- else if (conf->decommission_subvols_cnt) {
- search_subvol = layout_cold;
- }
- else if (!dict_get_ptr (this->options, "rule", &value) &&
- !strcmp(layout->list[layout_cold].xlator->name, value)) {
- search_subvol = layout_cold;
- }
+ subvol = TIER_HASHED_SUBVOL;
- if ((layout->list[search_subvol].err > 0) &&
- (layout->list[search_subvol].err != ENOTCONN))
- search_subvol = layout_cold;
-
- subvol = layout->list[search_subvol].xlator;
out:
-
return subvol;
}
@@ -1970,8 +1934,8 @@ struct xlator_fops fops = {
.open = dht_open,
.statfs = dht_statfs,
.opendir = dht_opendir,
- .readdir = dht_readdir,
- .readdirp = dht_readdirp,
+ .readdir = tier_readdir,
+ .readdirp = tier_readdirp,
.fsyncdir = dht_fsyncdir,
.symlink = dht_symlink,
.unlink = dht_unlink,