aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Patlasov2013-10-02 21:38:43 +0400
committerMiklos Szeredi2013-11-05 10:11:28 +0100
commit41b6e41fc609753a9386d24295f7ed03b28c4601 (patch)
tree923f7cdb4cc82f5506b2ebaf05c90013e35902d2
parent6eaf4782eb09e28dbd13d23b9ce0fb7646daf37e (diff)
fuse: writepages: update bdi writeout when deleting secondary request
BDI_WRITTEN counter is used to estimate bdi bandwidth. It must be incremented every time as bdi ends page writeback. No matter whether it was fulfilled by actual write or by discarding the request (e.g. due to shrunk i_size). Note that even before writepages patches, the case "Got truncated off completely" was handled in fuse_send_writepage() by calling fuse_writepage_finish() which updated BDI_WRITTEN unconditionally. Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
-rw-r--r--fs/fuse/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 1cb303eba4d0..e6fdd59a7906 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1701,11 +1701,14 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
if (old_req->num_pages == 1 && (old_req->state == FUSE_REQ_INIT ||
old_req->state == FUSE_REQ_PENDING)) {
+ struct backing_dev_info *bdi = page->mapping->backing_dev_info;
+
copy_highpage(old_req->pages[0], page);
spin_unlock(&fc->lock);
- dec_bdi_stat(page->mapping->backing_dev_info, BDI_WRITEBACK);
+ dec_bdi_stat(bdi, BDI_WRITEBACK);
dec_zone_page_state(page, NR_WRITEBACK_TEMP);
+ bdi_writeout_inc(bdi);
fuse_writepage_free(fc, new_req);
fuse_request_free(new_req);
goto out;