summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.h
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-10-02 07:30:39 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-02 06:30:23 -0700
commitef44323b4ba58fa8c1eb89105851983f828dd91b (patch)
treedcbfd98a87e1987145ab97366527b4e6e8900902 /xlators/mgmt/glusterd/src/glusterd-volgen.h
parent067d0e476abe42f1e290039cb903928080e90d8d (diff)
volgen: reimplement volgen
Generating a volfile occurs in two steps: - Build a graph (ie, glusterfs_graph_t instance) by graph manipulation primitives - Write out the graph to a file by the the graph printing API. Graph builder routines can optionally make use of a "modifier dict", which can contain overrides wrt. volume options. This can be used for a "dry-run" graph generation. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1750 (clean up volgen) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1750
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h134
1 files changed, 13 insertions, 121 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index 8173631a..3e877fd7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -24,134 +24,26 @@
#define _CONFIG_H
#include "config.h"
#endif
-#include "xlator.h"
-#include "protocol-common.h"
-#include "glusterd.h"
-#include "defaults.h"
-#include "list.h"
-#include "dict.h"
-#include "compat.h"
-#include "compat-errno.h"
-#include "glusterd-sm.h"
-#include "glusterd-op-sm.h"
-#include "cli1.h"
-#include "glusterd-mem-types.h"
-
-#define VOLGEN_GET_NFS_DIR(path) \
- do { \
- glusterd_conf_t *priv = THIS->private; \
- snprintf (path, PATH_MAX, "%s/nfs", priv->workdir);\
- } while (0); \
-
-#define VOLGEN_GET_VOLUME_DIR(path, volinfo) \
- do { \
- glusterd_conf_t *priv = THIS->private; \
- snprintf (path, PATH_MAX, "%s/vols/%s", priv->workdir, \
- volinfo->volname); \
- } while (0); \
-
-
-#define VOLGEN_GET_BRICK_DIR(path, volinfo) \
- do { \
- glusterd_conf_t *priv = THIS->private; \
- snprintf (path, PATH_MAX, "%s/%s/%s/%s", priv->workdir, \
- GLUSTERD_VOLUME_DIR_PREFIX, volinfo->volname, \
- GLUSTERD_BRICK_INFO_DIR); \
- } while (0); \
-
-
-#define VOLGEN_GENERATE_VOLNAME(str, volname, subvol) \
- do { \
- snprintf (str, 2048, "%s-%s", volname, subvol); \
- } while (0); \
-
-#define VOLGEN_POSIX_OPTION_ODIRECT "volgen_posix_option_statfssize"
-#define VOLGEN_POSIX_OPTION_STATFSSIZE "volgen_posix_option_statfssize"
-#define VOLGEN_POSIX_OPTION_MANDATTR "volgen_posix_option_mandattr"
-#define VOLGEN_POSIX_OPTION_SPANDEVICES "volgen_posix_option_spandevices"
-#define VOLGEN_POSIX_OPTION_BCKUNLINK "volgen_posix_option_bckunlink"
-
-#define VOLGEN_LOCKS_OPTION_TRACE "volgen_locks_option_trace"
-#define VOLGEN_LOCKS_OPTION_MAND "volgen_locks_option_mand"
-
-#define VOLGEN_CLIENT_OPTION_TRANSTYPE "volgen_client_option_transtype"
-#define VOLGEN_CLIENT_OPTION_NODELAY "volgen_client_option_nodelay"
-
-#define VOLGEN_IOT_OPTION_THREADCOUNT "volgen_iot_option_threadcount"
-#define VOLGEN_IOT_OPTION_AUTOSCALING "volgen_iot_option_autoscaling"
-#define VOLGEN_IOT_OPTION_MINTHREADS "volgen_iot_option_minthreads"
-#define VOLGEN_IOT_OPTION_MAXTHREADS "volgen_iot_option_maxthreads"
-
-#define VOLGEN_SERVER_OPTION_TRANSTYPE "volgen_server_option_transtype"
-#define VOLGEN_SERVER_OPTION_NODELAY "volgen_server_option_nodelay"
-#define VOLGEN_REPLICATE_OPTION_READSUBVOL "volgen_replicate_option_readsubvol"
-#define VOLGEN_REPLICATE_OPTION_FAVCHILD "volgen_replicate_option_favchild"
-#define VOLGEN_REPLICATE_OPTION_BCKSHCOUNT "volgen_replicate_option_bckshcount"
-#define VOLGEN_REPLICATE_OPTION_DATASH "volgen_replicate_option_datash"
-#define VOLGEN_REPLICATE_OPTION_DATASHALGO "volgen_replicate_option_datashalgo"
-#define VOLGEN_REPLICATE_OPTION_SHWINDOWSIZE "volgen_replicate_option_shwindowsize"
-#define VOLGEN_REPLICATE_OPTION_METASH "volgen_replicate_option_metash"
-#define VOLGEN_REPLICATE_OPTION_ENTRYSH "volgen_replicate_option_entrysh"
-#define VOLGEN_REPLICATE_OPTION_DATACHANGELOG "volgen_replicate_option_datachangelog"
-#define VOLGEN_REPLICATE_OPTION_METADATACHANGELOG "volgen_replicate_option_metadatachangelog"
-#define VOLGEN_REPLICATE_OPTION_ENTRYCHANGELOG "volgen_replicate_option_entrychangelog"
-#define VOLGEN_REPLICATE_OPTION_STRICTREADDIR "volgen_replicate_option_strictreaddir"
-
-#define VOLGEN_STRIPE_OPTION_BLOCKSIZE "volgen_stripe_option_blocksize"
-#define VOLGEN_STRIPE_OPTION_USEXATTR "volgen_stripe_option_usexattr"
-
-#define VOLGEN_DHT_OPTION_LOOKUPUNHASH "volgen_dht_option_lookupunhash"
-#define VOLGEN_DHT_OPTION_MINFREEDISK "volgen_dht_option_minfreedisk"
-#define VOLGEN_DHT_OPTION_UNHASHSTICKY "volgen_dht_option_unhashsticky"
-
-#define VOLGEN_WB_OPTION_FLUSHBEHIND "volgen_wb_option_flushbehind"
-#define VOLGEN_WB_OPTION_CACHESIZE "volgen_wb_option_cachesize"
-#define VOLGEN_WB_OPTION_DISABLENBYTES "volgen_wb_option_disablenbytes"
-#define VOLGEN_WB_OPTION_OSYNC "volgen_wb_option_osync"
-#define VOLGEN_WB_OPTION_TRICKLINGWRITES "volgen_wb_option_tricklingwrites"
-
-#define VOLGEN_RA_OPTION_ATIME "volgen_ra_option_atime"
-#define VOLGEN_RA_OPTION_PAGECOUNT "volgen_ra_option_pagecount"
-
-#define VOLGEN_IOCACHE_OPTION_PRIORITY "volgen_iocache_option_priority"
-#define VOLGEN_IOCACHE_OPTION_TIMEOUT "volgen_iocache_option_timeout"
-#define VOLGEN_IOCACHE_OPTION_CACHESIZE "volgen_iocache_option_cachesize"
-#define VOLGEN_IOCACHE_OPTION_MINFILESIZE "volgen_iocache_option_minfilesize"
-#define VOLGEN_IOCACHE_OPTION_MAXFILESIZE "volgen_iocache_option_maxfilesize"
-
-#define VOLGEN_QR_OPTION_PRIORITY "volgen_qr_option_priority"
-#define VOLGEN_QR_OPTION_TIMEOUT "volgen_qr_option_timeout"
-#define VOLGEN_QR_OPTION_CACHESIZE "volgen_qr_option_cachesize"
-#define VOLGEN_QR_OPTION_MAXFILESIZE "volgen_qr_option_maxfilesize"
-
-#define VOLGEN_IOS_OPTION_DUMP_FD_STATS "dump-fd-stats"
-#define VOLGEN_IOS_OPTION_MEASURE_LATENCY "latency-measurement"
-
-int
-glusterd_create_volfiles (glusterd_volinfo_t *volinfo);
+#include "glusterd.h"
-int
-glusterd_delete_volfile (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+struct volopt_map_entry {
+ char *key;
+ char *voltype;
+};
-int32_t
-glusterd_default_xlator_options (glusterd_volinfo_t *volinfo);
+extern struct volopt_map_entry glusterd_volopt_map[];
-char *
-glusterd_get_nfs_filepath ();
+int glusterd_create_rb_volfiles (glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
-int
-volgen_generate_nfs_volfile (glusterd_volinfo_t *volinfo);
+int glusterd_create_volfiles (glusterd_volinfo_t *volinfo);
-int
-uncomment_option( char *opt_str,char *comment_str);
+void glusterd_get_nfs_filepath (char *filename);
-int
-glusterd_generate_brick_volfile (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+int glusterd_create_nfs_volfile ();
-int
-glusterd_rb_create_volfiles (glusterd_volinfo_t *volinfo,
+int glusterd_delete_volfile (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo);
+
#endif