Message ID | 20200917225647.26481-2-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Allow readpage to return a locked page | expand |
On Thu, Sep 17, 2020 at 11:56:46PM +0100, Matthew Wilcox (Oracle) wrote: > iomap_read_page_end_io() is the only caller of iomap_read_finish() > and it makes future patches easier to have it inline. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 2a6492b3c4db..13b56d656337 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -167,13 +167,6 @@ void iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len) spin_unlock_irqrestore(&iop->uptodate_lock, flags); } -static void -iomap_read_finish(struct iomap_page *iop, struct page *page) -{ - if (!iop || atomic_dec_and_test(&iop->read_count)) - unlock_page(page); -} - static void iomap_read_page_end_io(struct bio_vec *bvec, int error) { @@ -187,7 +180,8 @@ iomap_read_page_end_io(struct bio_vec *bvec, int error) iomap_set_range_uptodate(page, bvec->bv_offset, bvec->bv_len); } - iomap_read_finish(iop, page); + if (!iop || atomic_dec_and_test(&iop->read_count)) + unlock_page(page); } static void
iomap_read_page_end_io() is the only caller of iomap_read_finish() and it makes future patches easier to have it inline. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- fs/iomap/buffered-io.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)