[PATCH] pagemap.h: Adds an if to check to see if PAGE_CACHE_SIZE >PAGE_SIZE.

From: Christopher P. Sacchi
Date: Fri Jan 04 2013 - 15:56:44 EST



Signed-off-by: Christopher P. Sacchi <chris.sacchi@xxxxxxxxx>
---
pagemap.patch | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 pagemap.patch

diff --git a/pagemap.patch b/pagemap.patch
new file mode 100644
index 0000000..ed12893
--- /dev/null
+++ b/pagemap.patch
@@ -0,0 +1,24 @@
+Signed-off-by: Christopher P. Sacchi chris.sacchi@xxxxxxxxx
+--- pagemap.h 2013-01-04 15:44:17.713123984 -0500
++++ pagemap.h 2013-01-04 15:46:35.681120547 -0500
+@@ -1,3 +1,4 @@
++START:
+ #ifndef _LINUX_PAGEMAP_H
+ #define _LINUX_PAGEMAP_H
+
+@@ -424,8 +425,14 @@ extern void add_page_wait_queue(struct p
+ * Fault a userspace page into pagetables. Return non-zero on a fault.
+ *
+ * This assumes that two userspace pages are always sufficient. That's
+- * not true if PAGE_CACHE_SIZE > PAGE_SIZE.
++ * not true if PAGE_CACHE_SIZE > PAGE_SIZE. Check if
++ * PAGE_CACHE_SIZE > PAGE_SIZE; return 1 if true,
++ * then goto START.
+ */
++if (PAGE_CACHE_SIZE > PAGE_SIZE) {
++ return 1;
++ goto START;
++}
+ static inline int fault_in_pages_writeable(char __user *uaddr, int size)
+ {
+ int ret;
--
1.7.9.5

Regards,

Christopher
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/