summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-08-20 16:11:02 +0530
committerVijay Bellur <vijay@gluster.com>2011-08-20 04:47:15 -0700
commitfdb7636bd719e560d9d8c0895a3b80bf3973b9d0 (patch)
tree0fe79c43b2c6188043141e2d08a89ceafc7165ce
parent80694bb5ff2f61cfd6e2bb7908add6c853490407 (diff)
while validating options, make sure memory accounting is init()ed.
Change-Id: Ifad5827c6b022de7d84e081ce77effda0c245a13 BUG: 3415 Reviewed-on: http://review.gluster.com/277 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--libglusterfs/src/options.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c
index ccd57e4f07f..b64b24e0489 100644
--- a/libglusterfs/src/options.c
+++ b/libglusterfs/src/options.c
@@ -25,6 +25,7 @@
#include <fnmatch.h>
#include "xlator.h"
+#include "defaults.h"
#define GF_OPTION_LIST_EMPTY(_opt) (_opt->value[0] == NULL)
@@ -727,6 +728,14 @@ xlator_validate_rec (xlator_t *xlator, char **op_errstr)
old_THIS = THIS;
THIS = xlator;
+
+ /* Need this here, as this graph has not yet called init() */
+ if (!xlator->mem_acct.num_types) {
+ if (!xlator->mem_acct_init)
+ xlator->mem_acct_init = default_mem_acct_init;
+ xlator->mem_acct_init (xlator);
+ }
+
ret = xlator_options_validate (xlator, xlator->options, op_errstr);
THIS = old_THIS;
h mem-pool.h byte-order.h gf-dirent.h locking.h syscall.h iobuf.h globals.h statedump.h checksum.h $(CONTRIBDIR)/md5/md5.h $(CONTRIBDIR)/rbtree/rb.h rbthash.h iatt.h latency.h mem-types.h $(CONTRIBDIR)/uuid/uuidd.h $(CONTRIBDIR)/uuid/uuid.h $(CONTRIBDIR)/uuid/uuidP.h $(CONTRIBDIR)/uuid/uuid_types.h syncop.h graph-utils.h trie.h run.h
EXTRA_DIST = graph.l graph.y $(CONTRIBDIR)/apple/daemon.c $(CONTRIBDIR)/apple/daemon.h
diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h
index 9d63d28af..d09472f99 100644
--- a/libglusterfs/src/mem-types.h
+++ b/libglusterfs/src/mem-types.h
@@ -104,6 +104,8 @@ enum gf_common_mem_types_ {
gf_common_mt_trie_node = 79,
gf_common_mt_trie_buf = 80,
gf_common_mt_trie_end = 81,
- gf_common_mt_end = 82
+ gf_common_mt_run_argv = 82,
+ gf_common_mt_run_logbuf = 83,
+ gf_common_mt_end = 84
};
#endif
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
new file mode 100644
index 000000000..052a2fdb5
--- /dev/null
+++ b/libglusterfs/src/run.c
@@ -0,0 +1,476 @@
+/*
+ Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com>
+ This file is part of GlusterFS.
+
+ GlusterFS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ GlusterFS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Affero General