mtd/fs/jffs2 file.c,1.80,1.81

David Woodhouse dwmw2 at infradead.org
Tue Nov 12 04:46:24 EST 2002


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv30076

Modified Files:
	file.c 
Log Message:
kmap() in commit_write because 2.5 needs it. It doesn't hurt much in 2.4.

Index: file.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/file.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- file.c	8 Nov 2002 22:43:19 -0000	1.80
+++ file.c	12 Nov 2002 09:46:22 -0000	1.81
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/time.h>
 #include <linux/pagemap.h>
+#include <linux/highmem.h>
 #include <linux/crc32.h>
 #include <linux/jffs2.h>
 #include "nodelist.h"
@@ -395,9 +396,15 @@
 	ri->isize = cpu_to_je32((uint32_t)inode->i_size);
 	ri->atime = ri->ctime = ri->mtime = cpu_to_je32(CURRENT_TIME);
 
-	/* We rely on the fact that generic_file_write() currently kmaps the page for us. */
+	/* In 2.4, it was already kmapped by generic_file_write(). Doesn't
+	   hurt to do it again. The alternative is ifdefs, which are ugly. */
+	kmap(pg);
+
 	ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + start,
-				      (pg->index << PAGE_CACHE_SHIFT) + start, end - start, &writtenlen);
+				      (pg->index << PAGE_CACHE_SHIFT) + start,
+				      end - start, &writtenlen);
+
+	kunmap(pg);
 
 	if (ret) {
 		/* There was an error writing. */





More information about the linux-mtd-cvs mailing list