fix
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 17 Jan 2006 12:42:39 +0000 (12:42 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Tue, 17 Jan 2006 12:42:39 +0000 (12:42 +0000)
ChangeLog
kernel/file.c
kernel/fuse_i.h

index efd5a3e6094af3d829b12f91d3bbbd42f16cdf93..1298d09b01cd949a64da722287eb3cf34cba5c9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,8 +10,6 @@
        * Connection may be aborted through either the sysfs interface or
        with 'umount -f mountpoint'
 
-       * 
-
 2006-01-14  Miklos Szeredi <miklos@szeredi.hu>
 
        * Released 2.5.0
index 42ab03728a31ca172395f99a7af5b51a8fcf328a..e8dae797ebdf5b92aa25a9fa09f59ae07398894f 100644 (file)
@@ -692,9 +692,15 @@ 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;
 }
 
index b68b9e3f5a5bf35e5402fb4f81c03e8ce41dc1b2..4979fac09f261f2f0b23068b9f350e0302ff5a29 100644 (file)
@@ -40,6 +40,9 @@
 #  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"