From 7db87a3f978a3b84ad5ff4baea9e313f559ebb08 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Sun, 20 Feb 2011 21:51:52 +0100 Subject: fuse_big_writes: Allow big writes (and reads) if available Speed up IO by doing >4kiB transfers, if supported by libfuse --- src/unionfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 +#include #include #include #include @@ -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); -- cgit v1.2.1