diff options
author | Anoop C S <achiraya@redhat.com> | 2014-11-19 16:27:05 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-01-06 01:55:38 -0800 |
commit | 50952cda111c84c966dc0427bbdb618e31bf8d78 (patch) | |
tree | 5ec60c3da29f66ead937711e0c3497bb2973330a /xlators | |
parent | 605db00dbad94d5bba6510e7695383715ef5035a (diff) |
rdma: Client volfile name change for supporting rdma
Backport of http://review.gluster.org/9146
For rdma only volumes, daemons like snapd, glustershd etc make
use of tcp transport for their operations. This patch will introduce
the support of rdma by default for those daemons in rdma only volumes.
In order to accomodate this change we rename the tcp client volfile
labels from
<volname>-fuse.vol
to
<volname>.tcp-fuse.vol
Change-Id: Id5e5db0680a07fa6b6d003bad45748464cd7658e
BUG: 1166515
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-on: http://review.gluster.org/9146
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/9183
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handshake.c | 22 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 4 |
2 files changed, 22 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index f2f5178a456..8c9194e1961 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -158,7 +158,8 @@ build_volfile_path (char *volume_id, char *path, char *free_ptr = NULL; char *volname = NULL; char *volid_ptr = NULL; - char path_prefix [PATH_MAX] = {0,}; + char dup_volid[PATH_MAX] = {0,}; + char path_prefix[PATH_MAX] = {0,}; xlator_t *this = NULL; glusterd_volinfo_t *volinfo = NULL; glusterd_conf_t *priv = NULL; @@ -275,10 +276,27 @@ gotvolinfo: ret = stat (path, &stbuf); if ((ret == -1) && (errno == ENOENT)) { + strcpy (dup_volid, volid_ptr); + if (!strchr (dup_volid, '.')) { + switch (volinfo->transport_type) { + case GF_TRANSPORT_TCP: + strcat (dup_volid, ".tcp"); + break; + case GF_TRANSPORT_RDMA: + strcat (dup_volid, ".rdma"); + break; + case GF_TRANSPORT_BOTH_TCP_RDMA: + strcat (dup_volid, ".tcp"); + break; + default: + ret = -1; + break; + } + } snprintf (path, path_len, "%s/%s/%s%s-fuse.vol", path_prefix, volinfo->volname, (trusted_str ? trusted_str : ""), - volid_ptr); + dup_volid); ret = stat (path, &stbuf); } out: diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c2869d0faba..bd58b0ef1bc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -9047,7 +9047,7 @@ glusterd_get_client_filepath (char *filepath, glusterd_volinfo_t *volinfo, switch (type) { case GF_TRANSPORT_TCP: snprintf (filepath, PATH_MAX, - "%s/%s-fuse.vol", path, volinfo->volname); + "%s/%s.tcp-fuse.vol", path, volinfo->volname); break; case GF_TRANSPORT_RDMA: @@ -9077,7 +9077,7 @@ glusterd_get_trusted_client_filepath (char *filepath, switch (type) { case GF_TRANSPORT_TCP: - snprintf (filepath, PATH_MAX, "%s/trusted-%s-fuse.vol", + snprintf (filepath, PATH_MAX, "%s/trusted-%s.tcp-fuse.vol", path, volinfo->volname); break; |