[sheepdog] [PATCH 2/3] add check for version of fuse before using 'big_writes'
Liu Yuan
namei.unix at gmail.com
Fri Aug 23 06:26:26 CEST 2013
On Thu, Aug 22, 2013 at 05:51:02PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
>
> The feature 'big_writes' in fuse only be supported from fuse-2.8, so if the fuse-library
> in the system is lower than 2.8, we would not use option "-obig_writes".
>
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> ---
> sheepfs/core.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/sheepfs/core.c b/sheepfs/core.c
> index 71253aa..2d9cd6a 100644
> --- a/sheepfs/core.c
> +++ b/sheepfs/core.c
> @@ -258,7 +258,9 @@ static int sheepfs_main_loop(char *mountpoint)
>
> fuse_opt_add_arg(&args, "sheepfs"); /* placeholder for argv[0] */
> fuse_opt_add_arg(&args, "-oallow_root");
> - fuse_opt_add_arg(&args, "-obig_writes");
> + /* 'big_writes' support only from fuse-2.8 */
> + if (FUSE_USE_VERSION >= 28)
> + fuse_opt_add_arg(&args, "-obig_writes");
I got this from fuse/fuse.h
/** @file
*
* This file defines the library interface of FUSE
*
* IMPORTANT: you should define FUSE_USE_VERSION before including this
* header. To use the newest API define it to 26 (recommended for any
* new application), to use the old API define it to 21 (default) 22
* or 25, to use the even older 1.X API define it to 11.
*/
I don't think you need FUSE_USE_VERSION, this is API version control, not the
version of fuse libraries.
Thanks
Yuan
More information about the sheepdog
mailing list