aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-01-14 04:42:36 -0500
committerJens Axboe <axboe@fb.com>2015-01-20 16:03:04 -0500
commitde1414a654e66b81b5348dbc5259ecf2fb61655e (patch)
tree2b3d60d6c0dc87ba33caff3e326d5648831d6176 /fs/fuse
parent26ff13047e3dc6c0230a629867e8dbd4a15a7626 (diff)
fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info
Now that we got rid of the bdi abuse on character devices we can always use sb->s_bdi to get at the backing_dev_info for a file, except for the block device special case. Export inode_to_bdi and replace uses of mapping->backing_dev_info with it to prepare for the removal of mapping->backing_dev_info. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Tejun Heo <tj@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 760b2c552197..19d80b82d344 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1159,7 +1159,7 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
1159 mutex_lock(&inode->i_mutex); 1159 mutex_lock(&inode->i_mutex);
1160 1160
1161 /* We can write back this queue in page reclaim */ 1161 /* We can write back this queue in page reclaim */
1162 current->backing_dev_info = mapping->backing_dev_info; 1162 current->backing_dev_info = inode_to_bdi(inode);
1163 1163
1164 err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode)); 1164 err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode));
1165 if (err) 1165 if (err)
@@ -1464,7 +1464,7 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
1464{ 1464{
1465 struct inode *inode = req->inode; 1465 struct inode *inode = req->inode;
1466 struct fuse_inode *fi = get_fuse_inode(inode); 1466 struct fuse_inode *fi = get_fuse_inode(inode);
1467 struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; 1467 struct backing_dev_info *bdi = inode_to_bdi(inode);
1468 int i; 1468 int i;
1469 1469
1470 list_del(&req->writepages_entry); 1470 list_del(&req->writepages_entry);
@@ -1658,7 +1658,7 @@ static int fuse_writepage_locked(struct page *page)
1658 req->end = fuse_writepage_end; 1658 req->end = fuse_writepage_end;
1659 req->inode = inode; 1659 req->inode = inode;
1660 1660
1661 inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK); 1661 inc_bdi_stat(inode_to_bdi(inode), BDI_WRITEBACK);
1662 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); 1662 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
1663 1663
1664 spin_lock(&fc->lock); 1664 spin_lock(&fc->lock);
@@ -1768,7 +1768,7 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
1768 1768
1769 if (old_req->num_pages == 1 && (old_req->state == FUSE_REQ_INIT || 1769 if (old_req->num_pages == 1 && (old_req->state == FUSE_REQ_INIT ||
1770 old_req->state == FUSE_REQ_PENDING)) { 1770 old_req->state == FUSE_REQ_PENDING)) {
1771 struct backing_dev_info *bdi = page->mapping->backing_dev_info; 1771 struct backing_dev_info *bdi = inode_to_bdi(page->mapping->host);
1772 1772
1773 copy_highpage(old_req->pages[0], page); 1773 copy_highpage(old_req->pages[0], page);
1774 spin_unlock(&fc->lock); 1774 spin_unlock(&fc->lock);
@@ -1872,7 +1872,7 @@ static int fuse_writepages_fill(struct page *page,
1872 req->page_descs[req->num_pages].offset = 0; 1872 req->page_descs[req->num_pages].offset = 0;
1873 req->page_descs[req->num_pages].length = PAGE_SIZE; 1873 req->page_descs[req->num_pages].length = PAGE_SIZE;
1874 1874
1875 inc_bdi_stat(page->mapping->backing_dev_info, BDI_WRITEBACK); 1875 inc_bdi_stat(inode_to_bdi(inode), BDI_WRITEBACK);
1876 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); 1876 inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
1877 1877
1878 err = 0; 1878 err = 0;