[PATCH 05/13] readahead: set file_ra_state->ra_pages to be at least mapping_min_order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Luis Chamberlain <mcgrof@xxxxxxxxxx>

Set the file_ra_state->ra_pages in file_ra_state_init() to be at least
mapping_min_order of pages if the bdi->ra_pages is less than that.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
 mm/readahead.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/readahead.c b/mm/readahead.c
index 369c70e2be42..8a610b78d94b 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -138,7 +138,11 @@
 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
+	unsigned int min_nrpages = mapping_min_folio_nrpages(mapping);
 	ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages;
+	if (ra->ra_pages < min_nrpages)
+		ra->ra_pages = min_nrpages;
 	ra->prev_pos = -1;

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux