diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-01-07 19:45:25 +0100 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 17:56:35 +0100 |
commit | 4c65422901154766e5cee17875ed680366a4a141 (patch) | |
tree | dbca9698daccdecf9a37dda282750cb3be3aef8a /mm/gup.c | |
parent | mm/gup: Fix some contiguous memmap assumptions (diff) | |
download | linux-4c65422901154766e5cee17875ed680366a4a141.tar.xz linux-4c65422901154766e5cee17875ed680366a4a141.zip |
mm/gup: Remove an assumption of a contiguous memmap
This assumption needs the inverse of nth_page(), which is temporarily
named page_nth() until it's renamed later in this series.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Diffstat (limited to 'mm/gup.c')
-rw-r--r-- | mm/gup.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -261,8 +261,8 @@ static inline struct page *compound_range_next(struct page *start, next = nth_page(start, i); page = compound_head(next); if (PageHead(page)) - nr = min_t(unsigned int, - page + compound_nr(page) - next, npages - i); + nr = min_t(unsigned int, npages - i, + compound_nr(page) - page_nth(page, next)); *ntails = nr; return page; |