[RH7,4/9] writeback: mark background writeback as such

Submitted by Pavel Tikhomirov on Sept. 21, 2019, 8:32 a.m.

Details

Message ID 20190921083227.8990-5-ptikhomirov@virtuozzo.com
State New
Series "block: backport writeback throttling"
Headers show

Commit Message

Pavel Tikhomirov Sept. 21, 2019, 8:32 a.m.
From: Jens Axboe <axboe@fb.com>

If we're doing background type writes, then use the appropriate
background write flags for that.

Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

https://jira.sw.ru/browse/PSBM-96243

(cherry picked from commit 13edd5e7315a26b448c5f7f33fc7721b1e0c17ef)
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 include/linux/writeback.h | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index fd3ec1c7b8a7..857a09cdd60d 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -92,6 +92,8 @@  static inline int wbc_to_write_flags(struct writeback_control *wbc)
 {
 	if (wbc->sync_mode == WB_SYNC_ALL)
 		return REQ_SYNC | REQ_NOIDLE;
+	else if (wbc->for_kupdate || wbc->for_background)
+		return REQ_BACKGROUND;
 
 	return 0;
 }