diff mbox series

[13/17] mm/filemap: Remove parameters from filemap_update_page()

Message ID 20201102184312.25926-14-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Refactor generic_file_buffered_read | expand

Commit Message

Matthew Wilcox Nov. 2, 2020, 6:43 p.m. UTC
The 'pos' and 'count' params are no longer used in filemap_update_page()

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/filemap.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Kent Overstreet Nov. 2, 2020, 7:52 p.m. UTC | #1
On Mon, Nov 02, 2020 at 06:43:08PM +0000, Matthew Wilcox (Oracle) wrote:
> The 'pos' and 'count' params are no longer used in filemap_update_page()
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>
Christoph Hellwig Nov. 3, 2020, 7:50 a.m. UTC | #2
On Mon, Nov 02, 2020 at 06:43:08PM +0000, Matthew Wilcox (Oracle) wrote:
> The 'pos' and 'count' params are no longer used in filemap_update_page()

Shouldn't this go into the patch that removes the usage of the parameters?
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index 7c6380a3a871..0ae8305ccb97 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2259,7 +2259,7 @@  static bool filemap_range_uptodate(struct kiocb *iocb,
 
 static int filemap_update_page(struct kiocb *iocb,
 		struct address_space *mapping, struct iov_iter *iter,
-		struct page *page, loff_t pos, loff_t count, bool first)
+		struct page *page, bool first)
 {
 	int error = -EAGAIN;
 
@@ -2330,8 +2330,8 @@  static int filemap_readahead(struct kiocb *iocb, struct file *file,
 {
 	if (iocb->ki_flags & IOCB_NOIO)
 		return -EAGAIN;
-	page_cache_async_readahead(mapping, ra, filp, page,
-			pg_index, last_index - pg_index);
+	page_cache_async_readahead(mapping, &file->f_ra, file, page,
+			page->index, last_index - page->index);
 	return 0;
 }
 
@@ -2374,22 +2374,17 @@  static int filemap_get_pages(struct kiocb *iocb, struct iov_iter *iter,
 got_pages:
 	if (nr_got > 0) {
 		struct page *page = pages[nr_got - 1];
-		pgoff_t pg_index = page->index;
-		loff_t pg_pos = max(iocb->ki_pos,
-				    (loff_t) pg_index << PAGE_SHIFT);
-		loff_t pg_count = iocb->ki_pos + iter->count - pg_pos;
 
 		if (PageReadahead(page))
 			err = filemap_readahead(iocb, filp, mapping, page,
 					last_index);
 		if (!err && !PageUptodate(page))
 			err = filemap_update_page(iocb, mapping, iter, page,
-					pg_pos, pg_count, nr_got == 1);
+					nr_got == 1);
 		if (err)
 			nr_got--;
 	}
 
-err:
 	if (likely(nr_got))
 		return nr_got;
 	if (err < 0)