summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-10-14 12:29:11 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-18 03:25:41 -0700
commit9be13aff89232c5ede11bdb37c49c2e5dca5d840 (patch)
treed6dade9b9e565fcbdf734c16e714163bdd7f6582 /xlators
parent7d752cec63db67ebfd61377ad7e5397074bbfbca (diff)
cluster/distribute: add option 'use-readdirp' to force readdirp
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1508 (add-brick works but files are not distributed to newly added server) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1508
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
-rw-r--r--xlators/cluster/dht/src/dht-common.h1
-rw-r--r--xlators/cluster/dht/src/dht.c12
3 files changed, 15 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index b0674f18e..82c3d6375 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2314,6 +2314,9 @@ dht_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
}
}
+ if (conf->use_readdirp)
+ op = GF_FOP_READDIRP;
+
dht_do_readdir (frame, this, fd, size, yoff, op);
return 0;
}
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index ca047ef32..bcbf0026a 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -142,6 +142,7 @@ struct dht_conf {
gf_lock_t layout_lock;
void *private; /* Can be used by wrapper xlators over
dht */
+ gf_boolean_t use_readdirp;
};
typedef struct dht_conf dht_conf_t;
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index d7f187457..72207b964 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -272,7 +272,14 @@ init (xlator_t *this)
&temp_str) == 0) {
gf_string2boolean (temp_str, &conf->unhashed_sticky_bit);
}
-
+
+ conf->use_readdirp = 0;
+
+ if (dict_get_str (this->options, "use-readdirp",
+ &temp_str) == 0) {
+ gf_string2boolean (temp_str, &conf->use_readdirp);
+ }
+
conf->disk_unit = 'p';
conf->min_free_disk = 10;
@@ -421,5 +428,8 @@ struct volume_options options[] = {
{ .key = {"unhashed-sticky-bit"},
.type = GF_OPTION_TYPE_BOOL
},
+ { .key = {"use-readdirp"},
+ .type = GF_OPTION_TYPE_BOOL
+ },
{ .key = {NULL} },
};