diff options
author | Bernd Schubert <bernd.schubert@fastmail.fm> | 2011-02-20 21:51:52 +0100 |
---|---|---|
committer | Bernd Schubert <bernd.schubert@fastmail.fm> | 2011-02-20 21:51:52 +0100 |
commit | 7db87a3f978a3b84ad5ff4baea9e313f559ebb08 (patch) | |
tree | 6db714e1dc6861aa6565fd7cccd882a4b9c5fd08 | |
parent | f3902a606d13ad17cace533c564172e77ba108db (diff) | |
download | unionfs-fuse-7db87a3f978a3b84ad5ff4baea9e313f559ebb08.tar.gz |
fuse_big_writes: Allow big writes (and reads) if available
Speed up IO by doing >4kiB transfers, if supported by libfuse
-rw-r--r-- | src/unionfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unionfs.c b/src/unionfs.c index 7e0674f..726062b 100644 --- a/src/unionfs.c +++ b/src/unionfs.c @@ -16,6 +16,7 @@ #endif #include <fuse.h> +#include <fuse/fuse_common.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -843,6 +844,15 @@ int main(int argc, char *argv[]) { } unionfs_post_opts(); +#ifdef FUSE_CAP_BIG_WRITES + /* libfuse > 0.8 supports large IO, also for reads, to increase performance + * We support any IO sizes, so lets enable that option */ + if (fuse_opt_add_arg(&args, "-obig_writes")) { + fprintf(stderr, "Failed to enable big writes!\n"); + exit(1); + } +#endif + umask(0); int res = fuse_main(args.argc, args.argv, &unionfs_oper, NULL); RETURN(uopt.doexit ? uopt.retval : res); |