summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c17
-rw-r--r--xlators/nfs/server/src/nfs.c21
2 files changed, 35 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 5224a91d4af..15c5274c8fc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -137,6 +137,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = {
{"performance.stat-prefetch", "performance/stat-prefetch", "!perf", "on"}, /* NODOC */
{"nfs.enable-ino32", "nfs/server", "nfs.enable-ino32",},
+ {"nfs.mem-factor", "nfs/server", "nfs.mem-factor",},
{NULL, }
};
@@ -1244,6 +1245,7 @@ build_nfs_graph (glusterfs_graph_t *graph, dict_t *mod_dict)
xlator_t *nfsxl = NULL;
char *skey = NULL;
char *enable_ino32 = NULL;
+ char *mem_factor = NULL;
char volume_id[64] = {0,};
int ret = 0;
@@ -1316,6 +1318,21 @@ build_nfs_graph (glusterfs_graph_t *graph, dict_t *mod_dict)
goto out;
}
}
+
+ if (!dict_get (set_dict, "nfs.mem-factor")) {
+ ret = glusterd_volinfo_get (voliter,
+ "nfs.mem-factor",
+ &mem_factor);
+ if (ret)
+ goto out;
+ if (mem_factor) {
+ ret = dict_set_str (set_dict,
+ "nfs.mem-factor",
+ mem_factor);
+ if (ret)
+ goto out;
+ }
+ }
memset (&cgraph, 0, sizeof (cgraph));
ret = build_client_graph (&cgraph, voliter, set_dict);
if (ret)
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index f7def106005..bd53990b4b5 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;