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/glusterfs | |
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/glusterfs')
-rw-r--r-- | libglusterfs/src/glusterfs/client_t.h | 21 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/common-utils.h | 5 |
2 files changed, 15 insertions, 11 deletions
diff --git a/libglusterfs/src/glusterfs/client_t.h b/libglusterfs/src/glusterfs/client_t.h index 8ef3665a9c2..6bc03271eed 100644 --- a/libglusterfs/src/glusterfs/client_t.h +++ b/libglusterfs/src/glusterfs/client_t.h @@ -15,6 +15,17 @@ #include "glusterfs/locking.h" /* for gf_lock_t, not included by glusterfs.h */ #include "glusterfs/atomic.h" /* for gf_atomic_t */ +/* auth_data structure is required by RPC layer. But as it is also used in + * client_t structure validation, comparision, it is critical that it is defined + * in the larger scope of libglusterfs, instead of libgfrpc. With this change, + * even RPC will use this structure */ +#define GF_CLIENTT_AUTH_BYTES 400 +typedef struct client_auth_data { + int flavour; + int datalen; + char authdata[GF_CLIENTT_AUTH_BYTES]; +} client_auth_data_t; + struct client_ctx { void *ctx_key; void *ctx_value; @@ -78,12 +89,6 @@ typedef struct clienttable clienttable_t; */ #define GF_CLIENTENTRY_ALLOCATED -2 -struct rpcsvc_auth_data; - -client_t * -gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid, - char *subdir_mount); - void gf_client_put(client_t *client, gf_boolean_t *detached); @@ -138,4 +143,8 @@ gf_client_dump_inodes(xlator_t *this); int gf_client_disconnect(client_t *client); +client_t * +gf_client_get(xlator_t *this, client_auth_data_t *cred, char *client_uid, + char *subdir_mount); + #endif /* _CLIENT_T_H */ diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h index b184031e565..a11c3a5f458 100644 --- a/libglusterfs/src/glusterfs/common-utils.h +++ b/libglusterfs/src/glusterfs/common-utils.h @@ -42,7 +42,6 @@ trap(void); #include "glusterfs/compat-uuid.h" #include "glusterfs/iatt.h" #include "glusterfs/libglusterfs-messages.h" -#include "protocol-common.h" #define STRINGIFY(val) #val #define TOSTRING(val) STRINGIFY(val) @@ -994,8 +993,6 @@ gf_is_str_int(const char *value); char *gf_uint64_2human_readable(uint64_t); int -get_vol_type(int type, int dist_count, int brick_count); -int validate_brick_name(char *brick); char * get_host_name(char *word, char **host); @@ -1147,8 +1144,6 @@ gf_getgrouplist(const char *user, gid_t group, gid_t **groups); int glusterfs_compute_sha256(const unsigned char *content, size_t size, char *sha256_hash); -char * -get_struct_variable(int mem_num, gf_gsync_status_t *sts_val); char * gf_strncpy(char *dest, const char *src, const size_t dest_size); |