summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/glusterfs.h6
-rw-r--r--libglusterfs/src/graph.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 48bb0ff4df6..5b9f375e6d3 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -201,6 +201,10 @@ struct _xlator_cmdline_option {
typedef struct _xlator_cmdline_option xlator_cmdline_option_t;
+#define GF_OPTION_ENABLE _gf_true
+#define GF_OPTION_DISABLE _gf_false
+#define GF_OPTION_DEFERRED 2
+
struct _cmd_args {
/* basic options */
char *volfile_server;
@@ -222,7 +226,7 @@ struct _cmd_args {
struct list_head xlator_options; /* list of xlator_option_t */
/* fuse options */
- int fuse_direct_io_mode_flag;
+ int fuse_direct_io_mode;
int volfile_check;
double fuse_entry_timeout;
double fuse_attribute_timeout;
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index a59b427bffe..2609b7625df 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -131,6 +131,14 @@ glusterfs_graph_insert (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx,
xlator_list_t *xlchild = NULL;
xlator_list_t *xlparent = NULL;
+ if (!ctx->master) {
+ gf_log ("glusterfs", GF_LOG_ERROR,
+ "volume \"%s\" can be added from command line only "
+ "on client side", type);
+
+ return -1;
+ }
+
ixl = GF_CALLOC (1, sizeof (*ixl), gf_common_mt_xlator_t);
if (!ixl)
return -1;
@@ -210,13 +218,11 @@ glusterfs_graph_mac_compat (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
cmd_args = &ctx->cmd_args;
-#ifdef GF_DARWIN_HOST_OS
- if (!cmd_args->mac_compat)
+ if (cmd_args->mac_compat == GF_OPTION_DISABLE)
return 0;
- ret = glusterfs_graph_insert (graph, ctx, ZR_XLATOR_MAC_COMPAT,
+ ret = glusterfs_graph_insert (graph, ctx, "features/mac-compat",
"mac-compat-autoload");
-#endif
return ret;
}