summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2019-06-27 16:39:49 -0400
committerJens Axboe <axboe@kernel.dk>2019-07-10 11:00:57 -0400
commit34e51a5e1a6e939ed7d99c38173821ab86d577f4 (patch)
treec3a151220052cd67699f4c0e2f04daad5f5d753b
parent9b0eb69b75bccada2d341d7e7ca342f0cb1c9a6a (diff)
blkcg, writeback: Rename wbc_account_io() to wbc_account_cgroup_owner()
wbc_account_io() does a very specific job - try to see which cgroup is actually dirtying an inode and transfer its ownership to the majority dirtier if needed. The name is too generic and confusing. Let's rename it to something more specific. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--Documentation/admin-guide/cgroup-v2.rst2
-rw-r--r--fs/btrfs/extent_io.c4
-rw-r--r--fs/buffer.c2
-rw-r--r--fs/ext4/page-io.c2
-rw-r--r--fs/f2fs/data.c4
-rw-r--r--fs/fs-writeback.c8
-rw-r--r--fs/mpage.c2
-rw-r--r--include/linux/writeback.h8
8 files changed, 16 insertions, 16 deletions
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index a5c845338d6d..6223f485f7e1 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -2114,7 +2114,7 @@ following two functions.
2114 a queue (device) has been associated with the bio and 2114 a queue (device) has been associated with the bio and
2115 before submission. 2115 before submission.
2116 2116
2117 wbc_account_io(@wbc, @page, @bytes) 2117 wbc_account_cgroup_owner(@wbc, @page, @bytes)
2118 Should be called for each data segment being written out. 2118 Should be called for each data segment being written out.
2119 While this function doesn't care exactly when it's called 2119 While this function doesn't care exactly when it's called
2120 during the writeback session, it's the easiest and most 2120 during the writeback session, it's the easiest and most
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index db337e53aab3..5106008f5e28 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2911,7 +2911,7 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
2911 bio = NULL; 2911 bio = NULL;
2912 } else { 2912 } else {
2913 if (wbc) 2913 if (wbc)
2914 wbc_account_io(wbc, page, page_size); 2914 wbc_account_cgroup_owner(wbc, page, page_size);
2915 return 0; 2915 return 0;
2916 } 2916 }
2917 } 2917 }
@@ -2924,7 +2924,7 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
2924 bio->bi_opf = opf; 2924 bio->bi_opf = opf;
2925 if (wbc) { 2925 if (wbc) {
2926 wbc_init_bio(wbc, bio); 2926 wbc_init_bio(wbc, bio);
2927 wbc_account_io(wbc, page, page_size); 2927 wbc_account_cgroup_owner(wbc, page, page_size);
2928 } 2928 }
2929 2929
2930 *bio_ret = bio; 2930 *bio_ret = bio;
diff --git a/fs/buffer.c b/fs/buffer.c
index e450c55f6434..40547bbbea94 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3093,7 +3093,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3093 3093
3094 if (wbc) { 3094 if (wbc) {
3095 wbc_init_bio(wbc, bio); 3095 wbc_init_bio(wbc, bio);
3096 wbc_account_io(wbc, bh->b_page, bh->b_size); 3096 wbc_account_cgroup_owner(wbc, bh->b_page, bh->b_size);
3097 } 3097 }
3098 3098
3099 submit_bio(bio); 3099 submit_bio(bio);
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 4690618a92e9..56e287f5ee50 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -404,7 +404,7 @@ submit_and_retry:
404 ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh)); 404 ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh));
405 if (ret != bh->b_size) 405 if (ret != bh->b_size)
406 goto submit_and_retry; 406 goto submit_and_retry;
407 wbc_account_io(io->io_wbc, page, bh->b_size); 407 wbc_account_cgroup_owner(io->io_wbc, page, bh->b_size);
408 io->io_next_block++; 408 io->io_next_block++;
409 return 0; 409 return 0;
410} 410}
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index eda4181d2092..e1cab1717ac7 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -470,7 +470,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
470 } 470 }
471 471
472 if (fio->io_wbc && !is_read_io(fio->op)) 472 if (fio->io_wbc && !is_read_io(fio->op))
473 wbc_account_io(fio->io_wbc, page, PAGE_SIZE); 473 wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE);
474 474
475 bio_set_op_attrs(bio, fio->op, fio->op_flags); 475 bio_set_op_attrs(bio, fio->op, fio->op_flags);
476 476
@@ -537,7 +537,7 @@ alloc_new:
537 } 537 }
538 538
539 if (fio->io_wbc) 539 if (fio->io_wbc)
540 wbc_account_io(fio->io_wbc, bio_page, PAGE_SIZE); 540 wbc_account_cgroup_owner(fio->io_wbc, bio_page, PAGE_SIZE);
541 541
542 io->last_block_in_bio = fio->new_blkaddr; 542 io->last_block_in_bio = fio->new_blkaddr;
543 f2fs_trace_ios(fio, 0); 543 f2fs_trace_ios(fio, 0);
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index a8a40bc26c2f..0aef79e934bb 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -706,7 +706,7 @@ void wbc_detach_inode(struct writeback_control *wbc)
706EXPORT_SYMBOL_GPL(wbc_detach_inode); 706EXPORT_SYMBOL_GPL(wbc_detach_inode);
707 707
708/** 708/**
709 * wbc_account_io - account IO issued during writeback 709 * wbc_account_cgroup_owner - account writeback to update inode cgroup ownership
710 * @wbc: writeback_control of the writeback in progress 710 * @wbc: writeback_control of the writeback in progress
711 * @page: page being written out 711 * @page: page being written out
712 * @bytes: number of bytes being written out 712 * @bytes: number of bytes being written out
@@ -715,8 +715,8 @@ EXPORT_SYMBOL_GPL(wbc_detach_inode);
715 * controlled by @wbc. Keep the book for foreign inode detection. See 715 * controlled by @wbc. Keep the book for foreign inode detection. See
716 * wbc_detach_inode(). 716 * wbc_detach_inode().
717 */ 717 */
718void wbc_account_io(struct writeback_control *wbc, struct page *page, 718void wbc_account_cgroup_owner(struct writeback_control *wbc, struct page *page,
719 size_t bytes) 719 size_t bytes)
720{ 720{
721 struct cgroup_subsys_state *css; 721 struct cgroup_subsys_state *css;
722 int id; 722 int id;
@@ -753,7 +753,7 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page,
753 else 753 else
754 wbc->wb_tcand_bytes -= min(bytes, wbc->wb_tcand_bytes); 754 wbc->wb_tcand_bytes -= min(bytes, wbc->wb_tcand_bytes);
755} 755}
756EXPORT_SYMBOL_GPL(wbc_account_io); 756EXPORT_SYMBOL_GPL(wbc_account_cgroup_owner);
757 757
758/** 758/**
759 * inode_congested - test whether an inode is congested 759 * inode_congested - test whether an inode is congested
diff --git a/fs/mpage.c b/fs/mpage.c
index 436a85260394..a63620cdb73a 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -647,7 +647,7 @@ alloc_new:
647 * the confused fail path above (OOM) will be very confused when 647 * the confused fail path above (OOM) will be very confused when
648 * it finds all bh marked clean (i.e. it will not write anything) 648 * it finds all bh marked clean (i.e. it will not write anything)
649 */ 649 */
650 wbc_account_io(wbc, page, PAGE_SIZE); 650 wbc_account_cgroup_owner(wbc, page, PAGE_SIZE);
651 length = first_unmapped << blkbits; 651 length = first_unmapped << blkbits;
652 if (bio_add_page(bio, page, length, 0) < length) { 652 if (bio_add_page(bio, page, length, 0) < length) {
653 bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); 653 bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 738a0c24874f..dda5cf228172 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -188,8 +188,8 @@ void wbc_attach_and_unlock_inode(struct writeback_control *wbc,
188 struct inode *inode) 188 struct inode *inode)
189 __releases(&inode->i_lock); 189 __releases(&inode->i_lock);
190void wbc_detach_inode(struct writeback_control *wbc); 190void wbc_detach_inode(struct writeback_control *wbc);
191void wbc_account_io(struct writeback_control *wbc, struct page *page, 191void wbc_account_cgroup_owner(struct writeback_control *wbc, struct page *page,
192 size_t bytes); 192 size_t bytes);
193void cgroup_writeback_umount(void); 193void cgroup_writeback_umount(void);
194 194
195/** 195/**
@@ -291,8 +291,8 @@ static inline void wbc_init_bio(struct writeback_control *wbc, struct bio *bio)
291{ 291{
292} 292}
293 293
294static inline void wbc_account_io(struct writeback_control *wbc, 294static inline void wbc_account_cgroup_owner(struct writeback_control *wbc,
295 struct page *page, size_t bytes) 295 struct page *page, size_t bytes)
296{ 296{
297} 297}
298 298