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

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Sat Sep 21 11:32:22 MSK 2019


From: Jens Axboe <axboe at fb.com>

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

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

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

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

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;
 }
-- 
2.21.0



More information about the Devel mailing list