From 9462fbfb3c8265bf3d018934c98732c99ce15521 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Sat, 3 Feb 2007 10:40:12 +0000 Subject: [PATCH] make it compile on "strange" kernels --- ChangeLog | 4 ++++ kernel/configure.ac | 7 +++++++ kernel/fuse_i.h | 2 ++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8137979..aceef05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ cases if request is interrupted" on 2007-01-19. Reported by José Antonio Sánchez + * kernel: make it compile on "strange" kernels which have emulated + mutexes via but no i_mutex. Reported by Tomasz + Mateja + 2007-01-30 Miklos Szeredi * Released 2.6.2 diff --git a/kernel/configure.ac b/kernel/configure.ac index ede26ff..08b6f3c 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -179,6 +179,13 @@ if test "$ENABLE_FUSE_MODULE" = y; then else AC_MSG_RESULT([no]) fi + AC_MSG_CHECKING([if inode has i_mutex field ]) + if egrep -qw "i_mutex" $kernelsrc/include/linux/fs.h; then + AC_DEFINE(HAVE_I_MUTEX, 1, [inode has i_mutex field]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi AC_MSG_CHECKING([if kernel has mutex.h ]) if test -f $kernelsrc/include/linux/mutex.h; then AC_DEFINE(HAVE_MUTEX_H, 1, [kernel has mutex.h]) diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index 5534fcd..f4e2ece 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -65,6 +65,8 @@ #define mutex_lock(m) down(m) #define mutex_unlock(m) up(m) #define mutex semaphore +#endif +#ifndef HAVE_I_MUTEX #define i_mutex i_sem /* Hack for struct inode */ #endif #ifndef KERNEL_2_6_19_PLUS -- 2.30.2