Skip to content

Commit

Permalink
orangefs: use folios in orangefs_readahead
Browse files Browse the repository at this point in the history
Patch series "remove page_endio()", v3.

It was decided to remove the page_endio() as per the previous RFC
discussion[1] of this series and move that functionality into the caller
itself.  One of the side benefit of doing that is the callers have been
modified to directly work on folios as page_endio() already worked on
folios.

As Christoph is doing ZRAM cleanups[4] which will get rid of page_endio()
function usage, I removed the final patch that removes page_endio()[5].  I
will send it separately after rc-1 once the zram cleanups are merged.

mpage changes were tested with a simple boot testing and running a fio
workload on ext2 filesystem.  orangefs was tested by Mike Marshall (No
code changes since he tested).


This patch (of 3):

Convert orangefs_readahead() from using struct page to struct folio.  This
conversion removes the call to page_endio() which is soon to be removed,
and simplifies the final page handling.

The page error flags is not required to be set in the error case as
orangefs doesn't depend on them.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lore.kernel.org/linux-mm/[email protected]/ [1]
Link: https://lore.kernel.org/linux-mm/[email protected]/ [2]
Link: https://lore.kernel.org/linux-mm/[email protected]/ [3]
Link: https://lore.kernel.org/linux-block/[email protected]/T/#t [4]
Link: https://lore.kernel.org/lkml/[email protected]/ [5]
Signed-off-by: Pankaj Raghav <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Mike Marshall <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Panky-codes authored and akpm00 committed Apr 18, 2023
1 parent 1462c52 commit cd01049
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/orangefs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -275,9 +275,10 @@ static void orangefs_readahead(struct readahead_control *rac)
ret = 0;

/* clean up. */
while ((page = readahead_page(rac))) {
page_endio(page, false, ret);
put_page(page);
while ((folio = readahead_folio(rac))) {
if (!ret)
folio_mark_uptodate(folio);
folio_unlock(folio);
}
}

Expand Down

0 comments on commit cd01049

Please sign in to comment.