From 1035b38a9a89713d50dcec6451fc5d3d77760686 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 19 Jan 2007 17:26:16 +0000 Subject: [PATCH] Build fix for 2.6.16 vanila and 2.6.15 FC5 kernels --- ChangeLog | 5 +++++ kernel/file.c | 6 ------ kernel/fuse_i.h | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3675c9c..c40b3c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-19 Miklos Szeredi + + * Build fix for 2.6.16 vanila and 2.6.15 FC5 kernels. Patch from + Ian Abbott + 2007-01-18 Miklos Szeredi * Fix abort in fuse_new() compatibility API for opts == NULL case. diff --git a/kernel/file.c b/kernel/file.c index 6cf71f3..3006d02 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -628,15 +628,9 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, 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; } diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index f5b26f2..5259ee1 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -55,16 +55,14 @@ #include #include #include -#ifdef KERNEL_2_6_17_PLUS -#include -#else -#include +#ifndef DEFINE_MUTEX #define DEFINE_MUTEX(m) DECLARE_MUTEX(m) #define mutex_init(m) init_MUTEX(m) #define mutex_destroy(m) do { } while (0) #define mutex_lock(m) down(m) #define mutex_unlock(m) up(m) #define mutex semaphore +#define i_mutex i_sem /* Hack for struct inode */ #endif #ifndef KERNEL_2_6_19_PLUS #define clear_nlink(inode) (inode)->i_nlink = 0 -- 2.30.2