aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2022-01-31 17:54:43 +0000
committerSteve French <[email protected]>2022-02-01 10:36:22 -0600
commit46f5cbdef7d4fbb0f857a3caddec6799d0b5bb2f (patch)
treeec458be1b9b601f56cac5125be378809c2966d3b
parent0174ee9947bd0f24fee2794b35258960d108b7aa (diff)
cifs: Fix the readahead conversion to manage the batch when reading from cache
Fix the readahead conversion to correctly manage the last batch skipping when reading from cache. This involves a readahead batch of one page or one folio, so set the batch size according to the number of constituent pages (should be 1 for a filesystem that doesn't do multipage folios yet). Signed-off-by: David Howells <[email protected]> cc: Steve French <[email protected]> Reviewed-by: Rohith Surabattula <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] Signed-off-by: Steve French <[email protected]>
-rw-r--r--fs/cifs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index a50912674915..e7af802dcfa6 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -4446,7 +4446,7 @@ static void cifs_readahead(struct readahead_control *ractl)
* by the cache.
*/
page = readahead_page(ractl);
-
+ last_batch_size = 1 << thp_order(page);
if (cifs_readpage_from_fscache(ractl->mapping->host,
page) < 0) {
/*