summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-08-16 12:18:42 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-08-28 09:36:00 +0000
commit1316624066cc1ff821f892ea6601a63ca2d0094a (patch)
tree71addcc43c9da0a249d935e35f700951622f1755 /utils
parent91d9da62ce95a14264950aaf2c100e089c455646 (diff)
gluster-block: use targetcli interactive mode
Currently, on each targetcli create call, rtslib will rebuild its bs_cache, so as the /sys/kernel/config/target/core dir gets more entries this takes longer and longer to scan. Hence using repetitive targetcli in the block create for creating iqn, backend, setting acls, setting globals will induce too much delay in block create. As the number of blocks on the node increases, the delay will be too longer. This does not happen if we open targetcli in interactive mode and just do multiple create commands form it, since the bs_cache is build once. Read More: https://goo.gl/8aYT38 Change-Id: I2be78a748e013f253ce8f99746989a1cf735a56f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c23
-rw-r--r--utils/utils.h4
2 files changed, 27 insertions, 0 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 3c2b9ad..e76c112 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -234,6 +234,29 @@ initLogging(void)
int
+gbRunnerExitStatus(int exitStatus)
+{
+ if (!WIFEXITED(exitStatus)) {
+ return -1;
+ }
+
+ return WEXITSTATUS(exitStatus);
+}
+
+
+int
+gbRunner(char *cmd)
+{
+ int childExitStatus;
+
+
+ childExitStatus = system(cmd);
+
+ return gbRunnerExitStatus(childExitStatus);
+}
+
+
+int
gbAlloc(void *ptrptr, size_t size,
const char *filename, const char *funcname, size_t linenr)
{
diff --git a/utils/utils.h b/utils/utils.h
index 43ce065..6cb4abc 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -438,6 +438,10 @@ void logTimeNow(char* buf, size_t bufSize);
int initLogging(void);
+int gbRunnerExitStatus(int exitStatus);
+
+int gbRunner(char *cmd);
+
int gbAlloc(void *ptrptr, size_t size,
const char *filename, const char *funcname, size_t linenr);