diff options
author | Csaba Henk <csaba@gluster.com> | 2010-08-27 09:39:33 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-02 09:50:11 -0700 |
commit | 588d807bdcbf5ed4df4d903428ab701479e9f8ac (patch) | |
tree | 005dbca4c07f5093bb77f2bc86c087a2459a9ab1 /xlators/mount/fuse/src/fuse-bridge.h | |
parent | 77db91866e9e8b333017e3bdb3079d024bb94818 (diff) |
fuse: introduce pre-test micro-framework, check for execve-over-direct-IO
The presence of some potential FUSE features in the actual kernel-side FUSE
implementation we run on is not always straightforward. More precisely, it is
straightforward only if there is a dedicated feature flag or protocol revision
number. In the other cases we are left to clumsy and platform specific hacks
which wire in 3rd-party software revision numbers into our source... at least,
if we insist on sticking to (the otherwise venerable) KISS principle.
However, here we go for another route, loosely inspired by the way autotools
provide an abstraction layer for our build system over the gory details of
platform specific build environments.
At start time, we use a preliminary set of FUSE operations which overlay the
standard ones such that apart from the "usual stuff", they also present some
synthetic files to the FUSE client (kernel). Then we spawn some test programs
which perform the needed tests on these synthetic files to evaulate the FUSE
implementation in terms of the features in question. According to the result
of the test programs, we set the respective parameters of the fuse xlator;
when the testing phase is over, the FUSE operation set is replaced by the
standard one.
As of now, we use this approach to test whether execve(2) works with
direct I/O. If yes, and if glusterfs is used with --enable-direct-io-mode,
then we let direct I/O for files opened for reading; if no, then we restrict
direct I/O only to writing files.
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 801 (Direct io-mode support and related changes in caching translators.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=801
Diffstat (limited to 'xlators/mount/fuse/src/fuse-bridge.h')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 547cc895268..4929252e169 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -27,6 +27,7 @@ #include <dirent.h> #include <sys/mount.h> #include <sys/time.h> +#include <sys/wait.h> #include <fnmatch.h> #ifndef _CONFIG_H @@ -85,6 +86,7 @@ struct fuse_private { char fuse_thread_started; uint32_t direct_io_mode; + char can_exec_directio; size_t *msg0_len_p; double entry_timeout; @@ -100,8 +102,10 @@ struct fuse_private { fuse_handler_t **fuse_ops; fuse_handler_t **fuse_ops0; + fuse_handler_t ***fuse_ops_flipped; pthread_mutex_t fuse_dump_mutex; int fuse_dump_fd; + char pre_test_stage; glusterfs_graph_t *next_graph; xlator_t *active_subvol; |