+2006-01-18 Miklos Szeredi <miklos@szeredi.hu>
+
+ * kernel: fix detection of case when fuse is not configured into
+ the kernel either as module or built-in
+
+ * fuse_opt.h: fix incompatibility with C++ compilers by renaming
+ 'template' structure member to 'templ'. Reported by Takashi Iwai
+
+ * fuse.h: fix compatibility bugs. Patch by Yura Pakhuchiy
+
+ * kernel: support version 2.6.16 (i_sem -> i_mutex)
+
2006-01-14 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.5.0
* Clearing ->connected or ->mounted connection flags could race
with setting other bitfields not protected with a lock
-
+
2006-01-10 Miklos Szeredi <miklos@szeredi.hu>
* kernel: add necessary compile flags for 2.4.X/x86_64.
-AC_INIT(fuse, 2.5.0)
+AC_INIT(fuse, 2.5.1)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(include/config.h)
# 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
# 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_MAJOR_VERSION 2
+# define FUSE_MINOR_VERSION 1
# define fuse_operations fuse_operations_compat2
# define fuse_main fuse_main_compat2
# define fuse_new fuse_new_compat2
# 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
*/
struct fuse_opt {
/** Matching template and optional parameter formatting */
- const char *template;
+ const char *templ;
/**
* Offset of variable within 'data' parameter of fuse_opt_parse()
/**
* Value to set the variable to, or to be passed as 'key' to the
- * processing function. Ignored if template a format
+ * processing function. Ignored if template has a format
*/
int value;
};
* Key option. In case of a match, the processing function will be
* called with the specified key.
*/
-#define FUSE_OPT_KEY(template, key) { template, -1U, key }
+#define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
/**
* Last option. An array of 'struct fuse_opt' must end with a NULL
* template value
*/
-#define FUSE_OPT_END { .template = NULL }
+#define FUSE_OPT_END { .templ = NULL }
/**
* Argument list
/**
* Key value passed to the processing function if an option did not
- * match any templated
+ * match any template
*/
#define FUSE_OPT_KEY_OPT -1
-AC_INIT(fuse-kernel, 2.5.0)
+AC_INIT(fuse-kernel, 2.5.1)
AC_CONFIG_HEADERS([config.h])
AC_PROG_INSTALL
fi
if test "$checkmodule" = yes; then
AC_MSG_CHECKING([if FUSE module is from official kernel])
- if fgrep -q "fuse distribution version: " /lib/modules/${runver}/kernel/fs/fuse/fuse.ko 2> /dev/null; then
+ if test ! -f /lib/modules/${runver}/kernel/fs/fuse/fuse.ko; then
+ AC_MSG_RESULT([no])
+ elif fgrep -q "fuse distribution version: " /lib/modules/${runver}/kernel/fs/fuse/fuse.ko 2> /dev/null; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
struct inode *inode = file->f_dentry->d_inode;
ssize_t res;
/* Don't allow parallel writes to the same file */
+#ifdef KERNEL_2_6_16_PLUS
+ mutex_lock(&inode->i_mutex);
+ res = fuse_direct_io(file, buf, count, ppos, 1);
+ mutex_unlock(&inode->i_mutex);
+#else
down(&inode->i_sem);
res = fuse_direct_io(file, buf, count, ppos, 1);
up(&inode->i_sem);
+#endif
return res;
}
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
# define KERNEL_2_6_13_PLUS
# endif
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+# define KERNEL_2_6_16_PLUS
+# endif
#endif
#include "config.h"
helper.c \
$(mount_source)
-libfuse_la_LDFLAGS = -lpthread -version-number 2:5:0 \
+libfuse_la_LDFLAGS = -lpthread -version-number 2:5:1 \
-Wl,--version-script,fuse_versionscript
EXTRA_DIST = fuse_versionscript
static const struct fuse_opt *find_opt(const struct fuse_opt *opt,
const char *arg, unsigned *sepp)
{
- for (; opt && opt->template; opt++)
- if (match_template(opt->template, arg, sepp))
+ for (; opt && opt->templ; opt++)
+ if (match_template(opt->templ, arg, sepp))
return opt;
return NULL;
}
return -1;
} else {
void *var = ctx->data + opt->offset;
- if (sep && opt->template[sep + 1]) {
+ if (sep && opt->templ[sep + 1]) {
const char *param = arg + sep;
- if (opt->template[sep] == '=')
+ if (opt->templ[sep] == '=')
param ++;
- if (process_opt_param(var, opt->template + sep + 1,
+ if (process_opt_param(var, opt->templ + sep + 1,
param, arg) == -1)
return -1;
} else
if (opt) {
for (; opt; opt = find_opt(opt + 1, arg, &sep)) {
int res;
- if (sep && opt->template[sep] == ' ' && !arg[sep])
+ if (sep && opt->templ[sep] == ' ' && !arg[sep])
res = process_opt_sep_arg(ctx, opt, sep, arg, iso);
else
res = process_opt(ctx, opt, sep, arg, iso);