From 29b664f062795614417b9348f40503360f9f9c56 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Tue, 11 Jan 2011 04:47:00 +0000 Subject: mgmt/Glusterd: make nfs.mem-factor settable through CLI Signed-off-by: Kaushik BV Signed-off-by: Anand V. Avati BUG: 2277 (Regression in Gluster NFS re-read performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2277 --- xlators/nfs/server/src/nfs.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xlators/nfs') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index f7def1060..bd53990b4 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -600,9 +600,10 @@ int validate_options (xlator_t *this, dict_t *options, char **op_errstr) { char *str=NULL; - gf_boolean_t nfs_ino32; - - int ret = 0; + gf_boolean_t nfs_ino32; + data_t *data = NULL; + long long lng = 0; + int ret = 0; @@ -620,6 +621,20 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) goto out; } } + + data = dict_get (options, "nfs.mem-factor"); + if (data) { + if (gf_string2longlong (data->data, &lng) != 0) { + gf_log (this->name, GF_LOG_ERROR, "invalid number format" + "\"%s\" in option " + "\"nfs.mem-factor\" ", + data->data ); + *op_errstr = gf_strdup ("Error, Invalid number format"); + ret = -1; + goto out; + } + } + ret =0; out: return ret; -- cgit