summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-02-26 08:09:25 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-02-27 16:13:55 +0530
commit8462dd88ad3531837ebfccd17a083467faa40227 (patch)
tree694d75c75bb88bcc67a4f1893330de03be0c4793 /glusterfsd
parentda9664587d414ba703c46839e3a4831ad3784a19 (diff)
volumefile modification awareness to make sure there are no inconsistencies.
Complete (including feature to properly umount) in my sense. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c14
-rw-r--r--glusterfsd/src/glusterfsd.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index a6f00bb5..37eefa01 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -130,6 +130,8 @@ static struct argp_option gf_options[] = {
{"attribute-timeout", ARGP_ATTRIBUTE_TIMEOUT_KEY, "SECONDS", 0,
"Set attribute timeout to SECONDS for inodes in fuse kernel module "
"[default: 1]"},
+ {"volfile-check", ARGP_VOLFILE_CHECK_KEY, 0, 0,
+ "enable strict volume file check in fuse notify"},
#ifdef GF_DARWIN_HOST_OS
{"non-local", ARGP_NON_LOCAL_KEY, 0, 0,
"Mount the macfuse volume without '-o local' option"},
@@ -236,6 +238,10 @@ _add_fuse_mount (xlator_t *graph)
ret = dict_set_double (top->options, ZR_ENTRY_TIMEOUT_OPT,
cmd_args->fuse_entry_timeout);
+ if (cmd_args->volfile_check)
+ ret = dict_set_int32 (top->options, ZR_STRICT_VOLFILE_CHECK,
+ cmd_args->volfile_check);
+
#ifdef GF_DARWIN_HOST_OS
/* On Darwin machines, O_APPEND is not handled,
* which may corrupt the data
@@ -335,6 +341,7 @@ static xlator_t *
_parse_specfp (glusterfs_ctx_t *ctx,
FILE *specfp)
{
+ int spec_fd = 0;
cmd_args_t *cmd_args = NULL;
xlator_t *tree = NULL, *trav = NULL, *new_tree = NULL;
@@ -365,6 +372,9 @@ _parse_specfp (glusterfs_ctx_t *ctx,
return NULL;
}
+ spec_fd = fileno (specfp);
+ get_checksum_for_file (spec_fd, &ctx->volfile_checksum);
+
/* if volume_name is given, then we attach to it */
if (cmd_args->volume_name) {
while (trav) {
@@ -756,6 +766,10 @@ parse_opts (int key, char *arg, struct argp_state *state)
"unknown attribute timeout %s", arg);
break;
+ case ARGP_VOLFILE_CHECK_KEY:
+ cmd_args->volfile_check = 1;
+ break;
+
case ARGP_VOLUME_NAME_KEY:
cmd_args->volume_name = strdup (arg);
break;
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index 87eca94a..0d6423ab 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -48,6 +48,7 @@
#define ZR_ATTR_TIMEOUT_OPT "attribute-timeout"
#define ZR_ENTRY_TIMEOUT_OPT "entry-timeout"
#define ZR_DIRECT_IO_OPT "direct-io-mode"
+#define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check"
enum argp_option_keys {
ARGP_VOLFILE_SERVER_KEY = 's',
@@ -69,6 +70,7 @@ enum argp_option_keys {
ARGP_NON_LOCAL_KEY = 139,
#endif /* DARWIN */
ARGP_VOLFILE_ID_KEY = 143,
+ ARGP_VOLFILE_CHECK_KEY = 144,
};
/* Moved here from fetch-spec.h */