diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-08-16 12:18:42 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-08-28 09:36:00 +0000 |
commit | 1316624066cc1ff821f892ea6601a63ca2d0094a (patch) | |
tree | 71addcc43c9da0a249d935e35f700951622f1755 /utils/utils.c | |
parent | 91d9da62ce95a14264950aaf2c100e089c455646 (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/utils.c')
-rw-r--r-- | utils/utils.c | 23 |
1 files changed, 23 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) { |