diff mbox series

[RFC,3/3] orangefs: use folio in orangefs_readahead()

Message ID 20230315123233.121593-4-p.raghav@samsung.com (mailing list archive)
State Mainlined, archived
Headers show
Series [RFC,1/3] filemap: convert page_endio to folio_endio | expand

Commit Message

Pankaj Raghav March 15, 2023, 12:32 p.m. UTC
Use folio and its corresponding function in orangefs_readahead() so that
folios can be directly passed to the folio_endio().

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 fs/orangefs/inode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Luis Chamberlain March 15, 2023, 2:48 p.m. UTC | #1
On Wed, Mar 15, 2023 at 01:32:33PM +0100, Pankaj Raghav wrote:
> Use folio and its corresponding function in orangefs_readahead() so that
> folios can be directly passed to the folio_endio().
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis
Matthew Wilcox March 15, 2023, 4:05 p.m. UTC | #2
On Wed, Mar 15, 2023 at 01:32:33PM +0100, Pankaj Raghav wrote:
> Use folio and its corresponding function in orangefs_readahead() so that
> folios can be directly passed to the folio_endio().

This is wrong; you need to drop the call to folio_put().

>  	/* clean up. */
> -	while ((page = readahead_page(rac))) {
> -		folio_endio(page_folio(page), false, ret);
> -		put_page(page);
> +	while ((folio = readahead_folio(rac))) {
> +		folio_endio(folio, false, ret);
> +		folio_put(folio);
>  	}
diff mbox series

Patch

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index b12d099510ea..7e03d60bd406 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -244,7 +244,7 @@  static void orangefs_readahead(struct readahead_control *rac)
 	struct iov_iter iter;
 	struct inode *inode = rac->mapping->host;
 	struct xarray *i_pages;
-	struct page *page;
+	struct folio *folio;
 	loff_t new_start = readahead_pos(rac);
 	int ret;
 	size_t new_len = 0;
@@ -275,9 +275,9 @@  static void orangefs_readahead(struct readahead_control *rac)
 		ret = 0;
 
 	/* clean up. */
-	while ((page = readahead_page(rac))) {
-		folio_endio(page_folio(page), false, ret);
-		put_page(page);
+	while ((folio = readahead_folio(rac))) {
+		folio_endio(folio, false, ret);
+		folio_put(folio);
 	}
 }