[PATCH] ramfs breaks without CONFIG_BLOCK
authorDimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Sat, 30 Dec 2006 00:48:24 +0000 (16:48 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sat, 30 Dec 2006 18:56:42 +0000 (10:56 -0800)
ramfs doesn't provide the .set_dirty_page a_op, and when the BLOCK layer is
not configured in, 'set_page_dirty' makes a call via a NULL pointer.

Signed-off-by: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ramfs/file-mmu.c
fs/ramfs/file-nommu.c

index 0947fb57dcf3425bb4952eb947dd9d3af05bfe2e..54ebbc84207f162f2f58a8d00a1e8403088d5fc0 100644 (file)
  */
 
 #include <linux/fs.h>
+#include <linux/mm.h>
 
 const struct address_space_operations ramfs_aops = {
        .readpage       = simple_readpage,
        .prepare_write  = simple_prepare_write,
-       .commit_write   = simple_commit_write
+       .commit_write   = simple_commit_write,
+       .set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {
index 61cbe1ef06b99c9d423f2be0aad2c8f979e759fa..e9d6c47332826501c2857514c6ba334366856791 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/highmem.h>
 #include <linux/init.h>
@@ -30,7 +31,8 @@ static int ramfs_nommu_setattr(struct dentry *, struct iattr *);
 const struct address_space_operations ramfs_aops = {
        .readpage               = simple_readpage,
        .prepare_write          = simple_prepare_write,
-       .commit_write           = simple_commit_write
+       .commit_write           = simple_commit_write,
+       .set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {