diff options
author | Poornima G <pgurusid@redhat.com> | 2015-07-20 16:44:32 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-06-02 21:58:43 -0700 |
commit | bc525b01002d7649be0ac28c5761c8ce92b6a658 (patch) | |
tree | 7b4292204fd8eba1bdc838c63780d7c30d26ac1f /xlators/mgmt/glusterd/src | |
parent | 851a58733fe9f78b03819080e4a6883c69d41032 (diff) |
glusterd: volgen and volume set changes for leases
Add leases xlator in volgen and also add corresponding volume set options
Change-Id: Ic5de50cdb87eaf6a833e739bc7e08fecbeca3de3
BUG: 1319992
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/11722
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 25 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.h | 1 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 10 |
3 files changed, 36 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 231117750f6..52bb75fd664 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2177,6 +2177,30 @@ out: } static int +brick_graph_add_leases (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, + dict_t *set_dict, glusterd_brickinfo_t *brickinfo) +{ + + xlator_t *xl = NULL; + int ret = -1; + + if (!graph || !volinfo || !set_dict) + goto out; + + xl = volgen_graph_add (graph, "features/leases", volinfo->volname); + if (!xl) { + gf_msg ("glusterd", GF_LOG_WARNING, 0, + GD_MSG_GRAPH_FEATURE_ADD_FAIL, + "failed to add features/leases to graph"); + goto out; + } + + ret = 0; +out: + return ret; +} + +static int brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, dict_t *set_dict, glusterd_brickinfo_t *brickinfo) { @@ -2387,6 +2411,7 @@ static volgen_brick_xlator_t server_graph_table[] = { {brick_graph_add_fdl, "fdl"}, {brick_graph_add_iot, "io-threads"}, {brick_graph_add_upcall, "upcall"}, + {brick_graph_add_leases, "leases"}, {brick_graph_add_pump, NULL}, {brick_graph_add_ro, NULL}, {brick_graph_add_worm, NULL}, diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h index d8dd70bc33b..f90177372dc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.h +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h @@ -99,6 +99,7 @@ typedef enum { GF_XLATOR_POSIX = 0, GF_XLATOR_ACL, GF_XLATOR_LOCKS, + GF_XLATOR_LEASES, GF_XLATOR_UPCALL, GF_XLATOR_IOT, GF_XLATOR_INDEX, diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 9f089e8dd3b..9202763691c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2907,6 +2907,16 @@ struct volopt_map_entry glusterd_volopt_map[] = { .voltype = "features/upcall", .op_version = GD_OP_VERSION_3_7_0, }, + /* Lease translator options */ + { .key = "features.leases", + .voltype = "features/leases", + .value = "off", + .op_version = GD_OP_VERSION_3_8_0, + }, + { .key = "features.lease-lock-recall-timeout", + .voltype = "features/leases", + .op_version = GD_OP_VERSION_3_8_0, + }, { .key = "disperse.background-heals", .voltype = "cluster/disperse", .op_version = GD_OP_VERSION_3_7_3, |