[patch 4/4] fuse: support writable mmap fix

From: Miklos Szeredi
Date: Wed Mar 19 2008 - 20:22:40 EST


From: Miklos Szeredi <mszeredi@xxxxxxx>

Set the BDI_CAP_NO_ACCT_WB capability, so that fuse can do it's own
accounting of writeback pages.

Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
---
fs/fuse/file.c | 3 ++-
fs/fuse/inode.c | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)

Index: linux/fs/fuse/file.c
===================================================================
--- linux.orig/fs/fuse/file.c 2008-03-18 19:27:43.000000000 +0100
+++ linux/fs/fuse/file.c 2008-03-18 19:43:40.000000000 +0100
@@ -1145,8 +1145,9 @@ static int fuse_writepage_locked(struct
req->end = fuse_writepage_end;
req->inode = inode;

+ inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK);
inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
- __end_page_writeback(page, false);
+ end_page_writeback(page);

spin_lock(&fc->lock);
list_add(&req->writepages_entry, &fi->writepages);
Index: linux/fs/fuse/inode.c
===================================================================
--- linux.orig/fs/fuse/inode.c 2008-03-18 19:27:43.000000000 +0100
+++ linux/fs/fuse/inode.c 2008-03-18 19:43:40.000000000 +0100
@@ -483,6 +483,8 @@ static struct fuse_conn *new_conn(struct
atomic_set(&fc->num_waiting, 0);
fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
fc->bdi.unplug_io_fn = default_unplug_io_fn;
+ /* fuse does it's own writeback accounting */
+ fc->bdi.capabilities = BDI_CAP_NO_ACCT_WB;
fc->dev = sb->s_dev;
err = bdi_init(&fc->bdi);
if (err)

--
--
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/