aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-22 17:13:27 -0400
committerJens Axboe <axboe@fb.com>2015-06-02 10:33:34 -0400
commit93f78d882865cb90020d0f80a9523c99cf46924c (patch)
tree6cd9c3531085c7d51fbd6ec2086142255bc2c219 /fs/fuse/file.c
parent4452226ea276e74fc3e252c88d9bb7e8f8e44bf0 (diff)
writeback: move backing_dev_info->bdi_stat[] into bdi_writeback
Currently, a bdi (backing_dev_info) embeds single wb (bdi_writeback) and the role of the separation is unclear. For cgroup support for writeback IOs, a bdi will be updated to host multiple wb's where each wb serves writeback IOs of a different cgroup on the bdi. To achieve that, a wb should carry all states necessary for servicing writeback IOs for a cgroup independently. This patch moves bdi->bdi_stat[] into wb. * enum bdi_stat_item is renamed to wb_stat_item and the prefix of all enums is changed from BDI_ to WB_. * BDI_STAT_BATCH() -> WB_STAT_BATCH() * [__]{add|inc|dec|sum}_wb_stat(bdi, ...) -> [__]{add|inc}_wb_stat(wb, ...) * bdi_stat[_error]() -> wb_stat[_error]() * bdi_writeout_inc() -> wb_writeout_inc() * stat init is moved to bdi_wb_init() and bdi_wb_exit() is added and frees stat. * As there's still only one bdi_writeback per backing_dev_info, all uses of bdi->stat[] are mechanically replaced with bdi->wb.stat[] introducing no behavior changes. Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Cc: Jens Axboe <axboe@kernel.dk> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Miklos Szeredi <miklos@szeredi.hu> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 5ef05b5c4cff..8c5e2fa68835 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1445,9 +1445,9 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
1445 1445
1446 list_del(&req->writepages_entry); 1446 list_del(&req->writepages_entry);
1447 for (i = 0; i < req->num_pages; i++) { 1447 for (i = 0; i < req->num_pages; i++) {
1448 dec_bdi_stat(bdi, BDI_WRITEBACK); 1448 dec_wb_stat(&bdi->wb, WB_WRITEBACK);
1449 dec_zone_page_state(req->pages[i], NR_WRITEBACK_TEMP); 1449 dec_zone_page_state(req->pages[i], NR_WRITEBACK_TEMP);
1450 bdi_writeout_inc(bdi); 1450 wb_writeout_inc(&bdi->wb);
1451 } 1451 }
1452 wake_up(&fi->page_waitq); 1452 wake_up(&fi->page_waitq);
1453} 1453}
@@ -1634,7 +1634,7 @@ static int fuse_writepage_locked(struct page *page)
1634 req->end = fuse_writepage_end; 1634 req->end = fuse_writepage_end;
1635 req->inode = inode; 1635 req->inode = inode;
1636 1636
1637 inc_bdi_stat(inode_to_bdi(inode), BDI_WRITEBACK); 1637 inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK);
1638 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); 1638 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
1639 1639
1640 spin_lock(&fc->lock); 1640 spin_lock(&fc->lock);
@@ -1749,9 +1749,9 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
1749 copy_highpage(old_req->pages[0], page); 1749 copy_highpage(old_req->pages[0], page);
1750 spin_unlock(&fc->lock); 1750 spin_unlock(&fc->lock);
1751 1751
1752 dec_bdi_stat(bdi, BDI_WRITEBACK); 1752 dec_wb_stat(&bdi->wb, WB_WRITEBACK);
1753 dec_zone_page_state(page, NR_WRITEBACK_TEMP); 1753 dec_zone_page_state(page, NR_WRITEBACK_TEMP);
1754 bdi_writeout_inc(bdi); 1754 wb_writeout_inc(&bdi->wb);
1755 fuse_writepage_free(fc, new_req); 1755 fuse_writepage_free(fc, new_req);
1756 fuse_request_free(new_req); 1756 fuse_request_free(new_req);
1757 goto out; 1757 goto out;
@@ -1848,7 +1848,7 @@ static int fuse_writepages_fill(struct page *page,
1848 req->page_descs[req->num_pages].offset = 0; 1848 req->page_descs[req->num_pages].offset = 0;
1849 req->page_descs[req->num_pages].length = PAGE_SIZE; 1849 req->page_descs[req->num_pages].length = PAGE_SIZE;
1850 1850
1851 inc_bdi_stat(inode_to_bdi(inode), BDI_WRITEBACK); 1851 inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK);
1852 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); 1852 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
1853 1853
1854 err = 0; 1854 err = 0;