diff options
author | Amar Tumballi <amar@gluster.com> | 2010-06-23 04:01:24 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-06-24 10:32:14 -0700 |
commit | b8b2a9d2f49686d5056fb0ce6150cf9c54180b12 (patch) | |
tree | 30e9594dc84dca425a37971324661a10285b75ef /xlators | |
parent | e82ca8fc5164f4ba2ff396da86b4a490d9a47370 (diff) |
change volume file options back to 'transport' from 'rpc-transport'
This helps to keep the backword compatibility with old volume files.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/protocol/rpc/rpc-lib/src/rpc-transport.c | 22 | ||||
-rw-r--r-- | xlators/protocol/rpc/rpc-transport/socket/src/name.c | 28 | ||||
-rw-r--r-- | xlators/protocol/rpc/rpc-transport/socket/src/socket.c | 32 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 6 |
4 files changed, 47 insertions, 41 deletions
diff --git a/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c b/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c index da3ba3521..577158904 100644 --- a/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c +++ b/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c @@ -856,14 +856,14 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) type = str; /* Backward compatibility */ - ret = dict_get_str (options, "rpc-transport-type", &type); + ret = dict_get_str (options, "transport-type", &type); if (ret < 0) { - ret = dict_set_str (options, "rpc-transport-type", "socket"); + ret = dict_set_str (options, "transport-type", "socket"); if (ret < 0) gf_log ("dict", GF_LOG_DEBUG, - "setting rpc-transport-type failed"); + "setting transport-type failed"); gf_log ("rpc-transport", GF_LOG_WARNING, - "missing 'option rpc-transport-type'. defaulting to " + "missing 'option transport-type'. defaulting to " "\"socket\""); } else { { @@ -883,11 +883,11 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) (is_ibsdp == 0)) { if (is_unix == 0) ret = dict_set_str (options, - "rpc-transport.address-family", + "transport.address-family", "unix"); if (is_ibsdp == 0) ret = dict_set_str (options, - "rpc-transport.address-family", + "transport.address-family", "inet-sdp"); if (ret < 0) @@ -895,17 +895,17 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) "setting address-family failed"); ret = dict_set_str (options, - "rpc-transport-type", "socket"); + "transport-type", "socket"); if (ret < 0) gf_log ("dict", GF_LOG_DEBUG, - "setting rpc-transport-type failed"); + "setting transport-type failed"); } } - ret = dict_get_str (options, "rpc-transport-type", &type); + ret = dict_get_str (options, "transport-type", &type); if (ret < 0) { gf_log ("rpc-transport", GF_LOG_ERROR, - "'option rpc-transport-type <xx>' missing in volume '%s'", + "'option transport-type <xx>' missing in volume '%s'", trans_name); goto fail; } @@ -922,7 +922,7 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) if (handle == NULL) { gf_log ("rpc-transport", GF_LOG_ERROR, "%s", dlerror ()); gf_log ("rpc-transport", GF_LOG_ERROR, - "volume '%s': rpc-transport-type '%s' is not valid or " + "volume '%s': transport-type '%s' is not valid or " "not found on this machine", trans_name, type); goto fail; diff --git a/xlators/protocol/rpc/rpc-transport/socket/src/name.c b/xlators/protocol/rpc/rpc-transport/socket/src/name.c index d8fc7d422..763fa3dd0 100644 --- a/xlators/protocol/rpc/rpc-transport/socket/src/name.c +++ b/xlators/protocol/rpc/rpc-transport/socket/src/name.c @@ -90,7 +90,7 @@ af_unix_client_bind (rpc_transport_t *this, struct sockaddr_un *addr = NULL; int32_t ret = 0; - path_data = dict_get (this->options, "rpc-transport.socket.bind-path"); + path_data = dict_get (this->options, "transport.socket.bind-path"); if (path_data) { char *path = data_to_str (path_data); if (!path || strlen (path) > UNIX_PATH_MAX) { @@ -130,20 +130,20 @@ client_fill_address_family (rpc_transport_t *this, sa_family_t *sa_family) } address_family_data = dict_get (this->options, - "rpc-transport.address-family"); + "transport.address-family"); if (!address_family_data) { data_t *remote_host_data = NULL, *connect_path_data = NULL; remote_host_data = dict_get (this->options, "remote-host"); connect_path_data = dict_get (this->options, - "rpc-transport.socket.connect-path"); + "transport.socket.connect-path"); if (!(remote_host_data || connect_path_data) || (remote_host_data && connect_path_data)) { gf_log (this->name, GF_LOG_ERROR, - "rpc-transport.address-family not specified and " + "transport.address-family not specified and " "not able to determine the " "same from other options (remote-host:%s and " - "rpc-transport.unix.connect-path:%s)", + "transport.unix.connect-path:%s)", data_to_str (remote_host_data), data_to_str (connect_path_data)); goto out; @@ -270,10 +270,10 @@ af_unix_client_get_remote_sockaddr (rpc_transport_t *this, int32_t ret = 0; connect_path_data = dict_get (this->options, - "rpc-transport.socket.connect-path"); + "transport.socket.connect-path"); if (!connect_path_data) { gf_log (this->name, GF_LOG_ERROR, - "option rpc-transport.unix.connect-path not specified for " + "option transport.unix.connect-path not specified for " "address-family unix"); ret = -1; goto err; @@ -282,7 +282,7 @@ af_unix_client_get_remote_sockaddr (rpc_transport_t *this, connect_path = data_to_str (connect_path_data); if (!connect_path) { gf_log (this->name, GF_LOG_ERROR, - "rpc-transport.unix.connect-path is null-string"); + "transport.unix.connect-path is null-string"); ret = -1; goto err; } @@ -317,10 +317,10 @@ af_unix_server_get_local_sockaddr (rpc_transport_t *this, listen_path_data = dict_get (this->options, - "rpc-transport.socket.listen-path"); + "transport.socket.listen-path"); if (!listen_path_data) { gf_log (this->name, GF_LOG_ERROR, - "missing option rpc-transport.socket.listen-path"); + "missing option transport.socket.listen-path"); ret = -1; goto err; } @@ -333,7 +333,7 @@ af_unix_server_get_local_sockaddr (rpc_transport_t *this, if (strlen (listen_path) > UNIX_PATH_MAX) { gf_log (this->name, GF_LOG_ERROR, - "option rpc-transport.unix.listen-path has value length " + "option transport.unix.listen-path has value length " "%"GF_PRI_SIZET" > %d", strlen (listen_path), UNIX_PATH_MAX); ret = -1; @@ -362,8 +362,8 @@ af_inet_server_get_local_sockaddr (rpc_transport_t *this, options = this->options; - listen_port_data = dict_get (options, "rpc-transport.socket.listen-port"); - listen_host_data = dict_get (options, "rpc-transport.socket.bind-address"); + listen_port_data = dict_get (options, "transport.socket.listen-port"); + listen_host_data = dict_get (options, "transport.socket.bind-address"); if (listen_port_data) { @@ -527,7 +527,7 @@ server_fill_address_family (rpc_transport_t *this, sa_family_t *sa_family) } address_family_data = dict_get (this->options, - "rpc-transport.address-family"); + "transport.address-family"); if (address_family_data) { char *address_family = NULL; address_family = data_to_str (address_family_data); diff --git a/xlators/protocol/rpc/rpc-transport/socket/src/socket.c b/xlators/protocol/rpc/rpc-transport/socket/src/socket.c index 01bc84039..5e56ff980 100644 --- a/xlators/protocol/rpc/rpc-transport/socket/src/socket.c +++ b/xlators/protocol/rpc/rpc-transport/socket/src/socket.c @@ -2190,13 +2190,13 @@ socket_init (rpc_transport_t *this) // By default, we enable NODELAY priv->nodelay = 1; - if (dict_get (this->options, "rpc-transport.socket.nodelay")) { + if (dict_get (this->options, "transport.socket.nodelay")) { optstr = data_to_str (dict_get (this->options, - "rpc-transport.socket.nodelay")); + "transport.socket.nodelay")); if (gf_string2boolean (optstr, &tmp_bool) == -1) { gf_log (this->name, GF_LOG_ERROR, - "'rpc-transport.socket.nodelay' takes only " + "'transport.socket.nodelay' takes only " "boolean options, not taking any action"); tmp_bool = 1; } @@ -2209,7 +2209,7 @@ socket_init (rpc_transport_t *this) optstr = NULL; - if (dict_get_str (this->options, "rpc-transport.window-size", + if (dict_get_str (this->options, "transport.window-size", &optstr) == 0) { if (gf_string2bytesize (optstr, &windowsize) != 0) { gf_log (this->name, GF_LOG_ERROR, @@ -2220,7 +2220,7 @@ socket_init (rpc_transport_t *this) optstr = NULL; - if (dict_get_str (this->options, "rpc-transport.socket.lowlat", + if (dict_get_str (this->options, "transport.socket.lowlat", &optstr) == 0) { priv->lowlat = 1; } @@ -2263,26 +2263,26 @@ init (rpc_transport_t *this) struct volume_options options[] = { { .key = {"remote-port", - "rpc-transport.remote-port", - "rpc-transport.socket.remote-port"}, + "transport.remote-port", + "transport.socket.remote-port"}, .type = GF_OPTION_TYPE_INT }, - { .key = {"rpc-transport.socket.listen-port", "listen-port"}, + { .key = {"transport.socket.listen-port", "listen-port"}, .type = GF_OPTION_TYPE_INT }, - { .key = {"rpc-transport.socket.bind-address", "bind-address" }, + { .key = {"transport.socket.bind-address", "bind-address" }, .type = GF_OPTION_TYPE_INTERNET_ADDRESS }, - { .key = {"rpc-transport.socket.connect-path", "connect-path"}, + { .key = {"transport.socket.connect-path", "connect-path"}, .type = GF_OPTION_TYPE_ANY }, - { .key = {"rpc-transport.socket.bind-path", "bind-path"}, + { .key = {"transport.socket.bind-path", "bind-path"}, .type = GF_OPTION_TYPE_ANY }, - { .key = {"rpc-transport.socket.listen-path", "listen-path"}, + { .key = {"transport.socket.listen-path", "listen-path"}, .type = GF_OPTION_TYPE_ANY }, - { .key = { "rpc-transport.address-family", + { .key = { "transport.address-family", "address-family" }, .value = {"inet", "inet6", "inet/inet6", "inet6/inet", "unix", "inet-sdp" }, @@ -2292,15 +2292,15 @@ struct volume_options options[] = { { .key = {"non-blocking-io"}, .type = GF_OPTION_TYPE_BOOL }, - { .key = {"rpc-transport.window-size"}, + { .key = {"transport.window-size"}, .type = GF_OPTION_TYPE_SIZET, .min = GF_MIN_SOCKET_WINDOW_SIZE, .max = GF_MAX_SOCKET_WINDOW_SIZE, }, - { .key = {"rpc-transport.socket.nodelay"}, + { .key = {"transport.socket.nodelay"}, .type = GF_OPTION_TYPE_BOOL }, - { .key = {"rpc-transport.socket.lowlat"}, + { .key = {"transport.socket.lowlat"}, .type = GF_OPTION_TYPE_BOOL }, { .key = {NULL} } diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 190da28e3..b59fd513a 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -671,6 +671,12 @@ struct volume_options options[] = { { .key = {"volume-filename.*"}, .type = GF_OPTION_TYPE_PATH, }, + { .key = {"transport.*"}, + .type = GF_OPTION_TYPE_ANY, + }, + { .key = {"rpc*"}, + .type = GF_OPTION_TYPE_ANY, + }, { .key = {"inode-lru-limit"}, .type = GF_OPTION_TYPE_INT, .min = 0, |