[patch 8/8] reiser4: fix for new aops patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Index: linux-2.6/fs/reiser4/plugin/item/extent_file_ops.c
===================================================================
--- linux-2.6.orig/fs/reiser4/plugin/item/extent_file_ops.c
+++ linux-2.6/fs/reiser4/plugin/item/extent_file_ops.c
@@ -7,7 +7,6 @@
 
 #include <linux/quotaops.h>
 #include <linux/swap.h>
-#include "../../../../mm/filemap.h"
 
 static inline reiser4_extent *ext_by_offset(const znode *node, int offset)
 {
@@ -937,6 +936,31 @@ static int write_extent_reserve_space(st
 	return reiser4_grab_space(count, 0 /* flags */);
 }
 
+/*
+ * filemap_copy_from_user no longer exists in generic code, because it
+ * is deadlocky (copying from user while holding the page lock is bad).
+ * As a temporary fix for reiser4, just define it here.
+ */
+static inline size_t
+filemap_copy_from_user(struct page *page, unsigned long offset,
+			const char __user *buf, unsigned bytes)
+{
+	char *kaddr;
+	int left;
+
+	kaddr = kmap_atomic(page, KM_USER0);
+	left = __copy_from_user_inatomic_nocache(kaddr + offset, buf, bytes);
+	kunmap_atomic(kaddr, KM_USER0);
+
+	if (left != 0) {
+		/* Do it the slow way */
+		kaddr = kmap(page);
+		left = __copy_from_user_nocache(kaddr + offset, buf, bytes);
+		kunmap(page);
+	}
+	return bytes - left;
+}
+
 /**
  * reiser4_write_extent - write method of extent item plugin
  * @file: file to write to
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux