Thread (11 messages) 11 messages, 2 authors, 2021-10-25
STALE1706d

[RFC PATCH 1/5] mm: Use file parameter to determine bdi

From: Goldwyn Rodrigues <hidden>
Date: 2021-10-22 20:15:30
Also in: linux-fsdevel
Subsystem: memory management, page cache, the rest · Maintainers: Andrew Morton, Matthew Wilcox, Linus Torvalds

From: Goldwyn Rodrigues <redacted>

This is done so the bdi inode is derived correctly when file->f_mapping
is not the same as mapping passed. Set conditionally because some
callee pass NULL for file pointer.

Signed-off-by: Goldwyn Rodrigues <redacted>
---
 mm/readahead.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/mm/readahead.c b/mm/readahead.c
index d589f147f4c2..9f303a31f650 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -443,6 +443,9 @@ static void ondemand_readahead(struct readahead_control *ractl,
 	unsigned long index = readahead_index(ractl);
 	pgoff_t prev_index;
 
+	if (ractl->file)
+		bdi = inode_to_bdi(file_inode(ractl->file));
+
 	/*
 	 * If the request exceeds the readahead window, allow the read to
 	 * be up to the optimal hardware IO size
-- 
2.33.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help