summaryrefslogtreecommitdiffstats
path: root/utils/utils.c
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-06-01 15:08:44 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-06-05 22:12:20 +0530
commit15d9ee36c71bfe3499d7f3baf3a483199211261f (patch)
treea085afa3fabe33aab37128a7f140f69032c4844f /utils/utils.c
parent3994aa8cf1bdcf3a07cddfefdb96cc2b94e01a97 (diff)
daemon: make glfs lru cache capacity configurable
$ gluster-blockd --help gluster-blockd (0.2) usage: gluster-blockd [--glfs-lru-count <count>] commands: --glfs-lru-count <count> glfs objects cache capacity [max: 512] (default: 5) --help show this message and exit. --version show version info and exit. Change-Id: I00a9277690a1c5ace51e223e9e4ed9ce61ae2428 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils/utils.c')
-rw-r--r--utils/utils.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 7f43bc4..49a5d3d 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -10,8 +10,19 @@
# include "utils.h"
+# include "config.h"
+const char *argp_program_version = "" \
+ PACKAGE_NAME" ("PACKAGE_VERSION")" \
+ "\nRepository rev: https://github.com/gluster/gluster-block.git\n" \
+ "Copyright (c) 2016 Red Hat, Inc. <https://redhat.com/>\n" \
+ "gluster-block comes with ABSOLUTELY NO WARRANTY.\n" \
+ "It is licensed to you under your choice of the GNU Lesser\n" \
+ "General Public License, version 3 or any later version (LGPLv3\n" \
+ "or later), or the GNU General Public License, version 2 (GPLv2),\n"\
+ "in all cases as published by the Free Software Foundation.";
+
int
glusterBlockCLIOptEnumParse(const char *opt)
@@ -24,7 +35,31 @@ glusterBlockCLIOptEnumParse(const char *opt)
}
for (i = 0; i < GB_CLI_OPT_MAX; i++) {
- if (!strcmp(opt, gbCmdlineOptLookup[i])) {
+ if (!strcmp(opt, gbCliCmdlineOptLookup[i])) {
+ return i;
+ }
+ }
+
+ return i;
+}
+
+
+int
+glusterBlockDaemonOptEnumParse(const char *opt)
+{
+ int i;
+
+
+ if (!opt) {
+ return GB_DAEMON_OPT_MAX;
+ }
+
+ for (i = 0; i < GB_DAEMON_OPT_MAX; i++) {
+ /* clip '--' from option */
+ while (*opt == '-') {
+ opt++;
+ }
+ if (!strcmp(opt, gbDaemonCmdlineOptLookup[i])) {
return i;
}
}