aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-22 17:13:26 -0400
committerJens Axboe <axboe@fb.com>2015-06-02 10:33:34 -0400
commit4452226ea276e74fc3e252c88d9bb7e8f8e44bf0 (patch)
tree793638cb2a6a027a84ec9cd69fc6cd68c330c212 /drivers/md/raid1.c
parentad7fa852d3d2816d68a138ebc5bc8967aeb7fd86 (diff)
writeback: move backing_dev_info->state 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->state into wb. * enum bdi_state is renamed to wb_state and the prefix of all enums is changed from BDI_ to WB_. * Explicit zeroing of bdi->state is removed without adding zeoring of wb->state as the whole data structure is zeroed on init anyway. * As there's still only one bdi_writeback per backing_dev_info, all uses of bdi->state are mechanically replaced with bdi->wb.state 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: drbd-dev@lists.linbit.com Cc: Neil Brown <neilb@suse.de> Cc: Alasdair Kergon <agk@redhat.com> Cc: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 9157a29c8dbf..f80f1af61ce7 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -745,7 +745,7 @@ static int raid1_congested(struct mddev *mddev, int bits)
745 struct r1conf *conf = mddev->private; 745 struct r1conf *conf = mddev->private;
746 int i, ret = 0; 746 int i, ret = 0;
747 747
748 if ((bits & (1 << BDI_async_congested)) && 748 if ((bits & (1 << WB_async_congested)) &&
749 conf->pending_count >= max_queued_requests) 749 conf->pending_count >= max_queued_requests)
750 return 1; 750 return 1;
751 751
@@ -760,7 +760,7 @@ static int raid1_congested(struct mddev *mddev, int bits)
760 /* Note the '|| 1' - when read_balance prefers 760 /* Note the '|| 1' - when read_balance prefers
761 * non-congested targets, it can be removed 761 * non-congested targets, it can be removed
762 */ 762 */
763 if ((bits & (1<<BDI_async_congested)) || 1) 763 if ((bits & (1 << WB_async_congested)) || 1)
764 ret |= bdi_congested(&q->backing_dev_info, bits); 764 ret |= bdi_congested(&q->backing_dev_info, bits);
765 else 765 else
766 ret &= bdi_congested(&q->backing_dev_info, bits); 766 ret &= bdi_congested(&q->backing_dev_info, bits);