From 182bad8bfd099da5e742da28c4820936eb1f3867 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 25 Nov 2013 15:16:23 +0530 Subject: cli, glusterd: More quota fixes ... ... which may be grouped under the following categories: 1. Fix incorrect cli exit status for 'quota list' cmd 2. Print appropriate error message on quota parse errors in cli Authored by: Anuradha Talur 3. glusterd: Improve quota validation during stage-op 4. Fix peer probe issues resulting from quota conf checksum mismatches 5. Enhancements to CLI output in the event of quota command failures Authored by: Kaushal Madappa 7. Move aux mount location from /tmp to /var/run/gluster Authored by: Krishnan Parthasarathi 8. Fix performance issues in quota limit-usage Authored by: Krutika Dhananjay Note: Some functions that were used in earlier version of quota, that aren't called anymore have been removed. Change-Id: I9d874f839ae5fdcfbe6d4f2d727eac091f27ac57 BUG: 969461 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/6366 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/common-utils.c | 70 ----------------------------------------- 1 file changed, 70 deletions(-) (limited to 'libglusterfs/src/common-utils.c') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 08efb5c9f..7862f6aa0 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -2994,76 +2994,6 @@ backtrace_symbols(void *const *trace, size_t len) #undef BELOW #endif /* __NetBSD__ */ -/* TODO: extract common code from gf_get_soft_limit and gf_get_hard_limit into a - * function - */ -int -gf_get_soft_limit (char *limit, char **soft_limit) -{ - int colon_count = 0; - int i = 0; - int len = 0; - char *sl = NULL; - - len = strlen (limit); - for (i = 0; i < len; i++) { - if (limit[i] == ':') - colon_count++; - if (colon_count == 2) - break; - } - - if (colon_count != 2) { - gf_log ("common-utils", GF_LOG_DEBUG, "Soft-limit absent"); - return 0; - } - - sl = GF_CALLOC (len - i, sizeof (char), gf_common_mt_char); - if (!sl) - return -1; - strncpy (sl, &limit[i+1], len - i - 1); - *soft_limit = sl; - - return 1; -} - -int -gf_get_hard_limit (char *limit, char **hard_limit) -{ - int i = 0; - int hlbegin = 0; - int len = 0; - char *hl = NULL; - - len = strlen (limit); - - for (i = 0; i < len; i++) { - if (limit[i] == ':') - break; - } - - if (i == len) { - gf_log ("common-utils", GF_LOG_ERROR, "Hard limit not found"); - return -1; - } - - hlbegin = i + 1; - i++; - - while ((limit[i] != '\0') && (limit[i] != ':')) { - i++; - } - - hl = GF_CALLOC (i - hlbegin + 1, sizeof (char), gf_common_mt_char); - if (!hl) - return -1; - - strncpy (hl, &limit[hlbegin], i - hlbegin); - *hard_limit = hl; - - return 0; -} - int gf_skip_header_section (int fd, int header_len) { -- cgit