From: Miklos Szeredi Date: Fri, 10 Mar 2006 10:18:20 +0000 (+0000) Subject: fix X-Git-Tag: fuse_2_6_0_pre2~6 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=87c7793d1dfef4962cf656a93875023e79e63b59;p=qemu-gpiodev%2Flibfuse.git fix --- diff --git a/ChangeLog b/ChangeLog index dd498f4..28cdb7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-10 Miklos Szeredi + + * Fix source compatibility breakage for fuse_unmount(). Report + from Yura Pakhuchiy + 2006-03-02 Miklos Szeredi * Fix O_ASYNC handling in fuse_dev_release(). From Jeff Dike diff --git a/include/fuse.h b/include/fuse.h index 6c0bb72..065ae75 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -535,41 +535,30 @@ void fuse_set_getcontext_func(struct fuse_context *(*func)(void)); * Compatibility stuff * * ----------------------------------------------------------- */ -#ifdef __FreeBSD__ -# if FUSE_USE_VERSION < 25 -# error On FreeBSD API version 25 or greater must be used -# endif -#endif - -#if FUSE_USE_VERSION == 25 || FUSE_USE_VERSION == 22 || \ - FUSE_USE_VERSION == 21 || FUSE_USE_VERSION == 11 +#if FUSE_USE_VERSION < 26 # include "fuse_compat.h" -# undef FUSE_MINOR_VERSION # undef fuse_main # if FUSE_USE_VERSION == 25 -# define FUSE_MINOR_VERSION 5 # define fuse_main(argc, argv, op) \ fuse_main_real_compat25(argc, argv, op, sizeof(*(op))) # define fuse_new fuse_new_compat25 # define fuse_setup fuse_setup_compat25 # define fuse_operations fuse_operations_compat25 # elif FUSE_USE_VERSION == 22 -# define FUSE_MINOR_VERSION 4 # define fuse_main(argc, argv, op) \ fuse_main_real_compat22(argc, argv, op, sizeof(*(op))) # define fuse_new fuse_new_compat22 # define fuse_setup fuse_setup_compat22 # define fuse_operations fuse_operations_compat22 # define fuse_file_info fuse_file_info_compat22 -# define fuse_mount fuse_mount_compat22 -# define fuse_unmount fuse_unmount_compat22 +# elif FUSE_USE_VERSION == 24 +# error Compatibility with high-level API version 24 not supported # else # define fuse_dirfil_t fuse_dirfil_t_compat # define __fuse_read_cmd fuse_read_cmd # define __fuse_process_cmd fuse_process_cmd # define __fuse_loop_mt fuse_loop_mt_proc # if FUSE_USE_VERSION == 21 -# define FUSE_MINOR_VERSION 1 # define fuse_operations fuse_operations_compat2 # define fuse_main fuse_main_compat2 # define fuse_new fuse_new_compat2 @@ -577,22 +566,14 @@ void fuse_set_getcontext_func(struct fuse_context *(*func)(void)); # define __fuse_teardown fuse_teardown # define __fuse_exited fuse_exited # define __fuse_set_getcontext_func fuse_set_getcontext_func -# define fuse_mount fuse_mount_compat22 # else -# warning Compatibility with API version 11 is deprecated -# undef FUSE_MAJOR_VERSION -# define FUSE_MAJOR_VERSION 1 -# define FUSE_MINOR_VERSION 1 # define fuse_statfs fuse_statfs_compat1 # define fuse_operations fuse_operations_compat1 # define fuse_main fuse_main_compat1 # define fuse_new fuse_new_compat1 -# define fuse_mount fuse_mount_compat1 # define FUSE_DEBUG FUSE_DEBUG_COMPAT1 # endif # endif -#elif FUSE_USE_VERSION < 26 -# error Compatibility with API version other than 21, 22, 25 and 11 not supported #endif #ifdef __cplusplus diff --git a/include/fuse_common.h b/include/fuse_common.h index f05d237..056b92b 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -120,6 +120,35 @@ int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint, int *multithreaded, int *foreground); +#if FUSE_USE_VERSION < 26 +# ifdef __FreeBSD__ +# if FUSE_USE_VERSION < 25 +# error On FreeBSD API version 25 or greater must be used +# endif +# endif +# include "fuse_common_compat.h" +# undef FUSE_MINOR_VERSION +# undef fuse_main +# define fuse_unmount fuse_unmount_compat22 +# if FUSE_USE_VERSION == 25 +# define FUSE_MINOR_VERSION 5 +# elif FUSE_USE_VERSION == 24 || FUSE_USE_VERSION == 22 +# define FUSE_MINOR_VERSION 4 +# define fuse_mount fuse_mount_compat22 +# elif FUSE_USE_VERSION == 21 +# define FUSE_MINOR_VERSION 1 +# define fuse_mount fuse_mount_compat22 +# elif FUSE_USE_VERSION == 11 +# warning Compatibility with API version 11 is deprecated +# undef FUSE_MAJOR_VERSION +# define FUSE_MAJOR_VERSION 1 +# define FUSE_MINOR_VERSION 1 +# define fuse_mount fuse_mount_compat1 +# else +# error Compatibility with API version other than 21, 22, 24, 25 and 11 not supported +# endif +#endif + #ifdef __cplusplus } #endif diff --git a/include/fuse_common_compat.h b/include/fuse_common_compat.h new file mode 100644 index 0000000..ce54fdf --- /dev/null +++ b/include/fuse_common_compat.h @@ -0,0 +1,17 @@ +/* + FUSE: Filesystem in Userspace + Copyright (C) 2001-2006 Miklos Szeredi + + This program can be distributed under the terms of the GNU LGPL. + See the file COPYING.LIB. +*/ + +/* these definitions provide source compatibility to prior versions. + Do not include this file directly! */ + +int fuse_mount_compat22(const char *mountpoint, const char *opts); + +int fuse_mount_compat1(const char *mountpoint, const char *args[]); + +void fuse_unmount_compat22(const char *mountpoint); + diff --git a/include/fuse_compat.h b/include/fuse_compat.h index ef7ff67..a2144f0 100644 --- a/include/fuse_compat.h +++ b/include/fuse_compat.h @@ -62,8 +62,6 @@ struct fuse *fuse_setup_compat25(int argc, char *argv[], size_t op_size, char **mountpoint, int *multithreaded, int *fd); -void fuse_unmount_compat22(const char *mountpoint); - #ifndef __FreeBSD__ #include @@ -125,8 +123,6 @@ int fuse_main_real_compat22(int argc, char *argv[], const struct fuse_operations_compat22 *op, size_t op_size); -int fuse_mount_compat22(const char *mountpoint, const char *opts); - typedef int (*fuse_dirfil_t_compat) (fuse_dirh_t h, const char *name, int type); struct fuse_operations_compat2 { int (*getattr) (const char *, struct stat *); @@ -196,8 +192,6 @@ struct fuse_operations_compat1 { #define FUSE_DEBUG_COMPAT1 (1 << 1) -int fuse_mount_compat1(const char *mountpoint, const char *args[]); - struct fuse *fuse_new_compat1(int fd, int flags, const struct fuse_operations_compat1 *op); void fuse_main_compat1(int argc, char *argv[], const struct fuse_operations_compat1 *op); diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index f042dfb..3cfff32 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -1236,27 +1236,19 @@ void fuse_remove_signal_handlers(struct fuse_session *se); * Compatibility stuff * * ----------------------------------------------------------- */ -#ifdef __FreeBSD__ -# if FUSE_USE_VERSION < 25 -# error On FreeBSD API version 25 or greater must be used -# endif -#endif - -#if FUSE_USE_VERSION == 25 || FUSE_USE_VERSION == 24 +#if FUSE_USE_VERSION < 26 # include "fuse_lowlevel_compat.h" # undef FUSE_MINOR_VERSION # if FUSE_USE_VERSION == 25 -# define FUSE_MINOR_VERSION 5 # define fuse_lowlevel_ops fuse_lowlevel_ops_compat25 # define fuse_lowlevel_new fuse_lowlevel_new_compat25 -# else -# define FUSE_MINOR_VERSION 4 +# elif FUSE_USE_VERSION == 24 # define fuse_file_info fuse_file_info_compat # define fuse_reply_statfs fuse_reply_statfs_compat # define fuse_reply_open fuse_reply_open_compat +# else +# error Compatibility with low-level API version < 24 not supported # endif -#elif FUSE_USE_VERSION < 26 -# error Compatibility with low level API version other than 24 and 25 not supported #endif #ifdef __cplusplus