diff options
author | Amar Tumballi <amar@gluster.com> | 2012-01-17 05:28:51 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2012-01-24 20:14:17 -0800 |
commit | b02afc6d008f9959db28244eb2b9dd3b9ef92393 (patch) | |
tree | c0bad790fb34f8ab2747b480d334cf9af75c5514 /libglusterfs/src/common-utils.c | |
parent | 0694749c3e5039be327110a64dd66619b5d9121c (diff) |
core: change lk-owner as a 1k buffer
so, NLM can send the lk-owner field directly to the locks translators,
while doing the same effort, also enabled sending maximum of 500 aux gid
over protocol.
Change-Id: I87c2514392748416f7ffe21d5154faad2e413969
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 767229
Reviewed-on: http://review.gluster.com/779
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index b9f752b750b..ce1e1f45bff 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -40,6 +40,7 @@ #include <netinet/in.h> #include <arpa/inet.h> #include <signal.h> +#include <stdlib.h> #include "logging.h" #include "common-utils.h" @@ -48,6 +49,7 @@ #include "stack.h" #include "globals.h" #include "md5.h" +#include "lkowner.h" #ifndef AI_ADDRCONFIG #define AI_ADDRCONFIG 0 @@ -1656,6 +1658,25 @@ uuid_utoa_r (uuid_t uuid, char *dst) return dst; } +/*Thread safe conversion function*/ +char * +lkowner_utoa (gf_lkowner_t *lkowner) +{ + char *lkowner_buffer = glusterfs_lkowner_buf_get(); + lkowner_unparse (lkowner, lkowner_buffer, GF_LKOWNER_BUF_SIZE); + return lkowner_buffer; +} + +/*Re-entrant conversion function*/ +char * +lkowner_utoa_r (gf_lkowner_t *lkowner, char *dst, int len) +{ + if(!dst) + return NULL; + lkowner_unparse (lkowner, dst, len); + return dst; +} + void _get_md5_str (char *out_str, size_t outlen, const uint8_t *input, int n) { |