]> Git Repo - linux.git/commitdiff
cifs: Fix the readahead conversion to manage the batch when reading from cache
authorDavid Howells <[email protected]>
Mon, 31 Jan 2022 17:54:43 +0000 (17:54 +0000)
committerSteve French <[email protected]>
Tue, 1 Feb 2022 16:36:22 +0000 (10:36 -0600)
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]>
fs/cifs/file.c

index a50912674915389e3e82b786a5f8e23e942354c7..e7af802dcfa600293aa6bf58539dd769892ac6ff 100644 (file)
@@ -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) {
                                        /*
This page took 0.063066 seconds and 4 git commands to generate.