* Fix Oops caused by premature release of fuse_conn. Clean up
related code, to be more readable
+ * Sendfile should not use page cache if "direct_io" mount option
+ is given
+
2005-04-08 Miklos Szeredi <miklos@szeredi.hu>
* Fix Oops in case of nfs export. Spotted by David Shaw
}
#ifdef KERNEL_2_6
+static ssize_t fuse_file_sendfile(struct file *file, loff_t *ppos,
+ size_t count, read_actor_t actor,
+ void *target)
+{
+ struct fuse_conn *fc = get_fuse_conn(file->f_dentry->d_inode);
+ if (fc->flags & FUSE_DIRECT_IO)
+ return -EINVAL;
+ else
+ return generic_file_sendfile(file, ppos, count, actor, target);
+}
+
static int fuse_set_page_dirty(struct page *page)
{
printk("fuse_set_page_dirty: should not happen\n");
.release = fuse_release,
.fsync = fuse_fsync,
#ifdef KERNEL_2_6
- .sendfile = generic_file_sendfile,
+ .sendfile = fuse_file_sendfile,
#endif
};