diff options
author | Amar Tumballi <amarts@redhat.com> | 2019-06-28 22:51:37 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-08-16 05:37:03 +0000 |
commit | 29cfe643cbcf7826375a3d52ff1865706a35bc38 (patch) | |
tree | add22d6f9e8b8afaae089625526d521c53c8b33c /libglusterfs/src/client_t.c | |
parent | a24288c5c9da9137eb1d5d487bc7cd11af01b88b (diff) |
libglusterfs: remove dependency of rpc
Goal: 'libglusterfs' files shouldn't have any dependency outside of
the tree, specially the header files, shouldn't have '#include'
from outside the tree.
Fixes:
* Had to introduce libglusterd so, methods and structures required
for only mgmt/glusterd, and cli/ are separated from 'libglusterfs/'
* Remove rpc/xdr/gen from build, which was used mainly so
dependency for libglusterfs could be properly satisfied.
* Move rpcsvc_auth_data to client_t.h, so all dependencies could
be handled.
Updates: bz#1636297
Change-Id: I0e80243a5a3f4615e6fac6e1b947ad08a9363fce
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/client_t.c')
-rw-r--r-- | libglusterfs/src/client_t.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c index e875c8b6b69..871fea6413c 100644 --- a/libglusterfs/src/client_t.c +++ b/libglusterfs/src/client_t.c @@ -13,7 +13,6 @@ #include "glusterfs/statedump.h" #include "glusterfs/client_t.h" #include "glusterfs/list.h" -#include "rpcsvc.h" #include "glusterfs/libglusterfs-messages.h" static int @@ -153,7 +152,7 @@ gf_client_clienttable_destroy(clienttable_t *clienttable) * as long as ref.bind is > 0 client should be alive. */ client_t * -gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid, +gf_client_get(xlator_t *this, client_auth_data_t *cred, char *client_uid, char *subdir_mount) { client_t *client = NULL; @@ -181,11 +180,10 @@ gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid, * if auth was used, matching auth flavour and data */ if (strcmp(client_uid, client->client_uid) == 0 && - (cred->flavour != AUTH_NONE && - (cred->flavour == client->auth.flavour && - (size_t)cred->datalen == client->auth.len && - memcmp(cred->authdata, client->auth.data, client->auth.len) == - 0))) { + (cred->flavour && (cred->flavour == client->auth.flavour && + (size_t)cred->datalen == client->auth.len && + memcmp(cred->authdata, client->auth.data, + client->auth.len) == 0))) { GF_ATOMIC_INC(client->bind); goto unlock; } @@ -227,7 +225,7 @@ gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid, GF_ATOMIC_INIT(client->fd_cnt, 0); client->auth.flavour = cred->flavour; - if (cred->flavour != AUTH_NONE) { + if (cred->flavour) { client->auth.data = GF_MALLOC(cred->datalen, gf_common_mt_client_t); if (client->auth.data == NULL) { GF_FREE(client->scratch_ctx.ctx); |