@@ -2083,19 +2083,19 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
if (retry_op > HAVE_RETRIED && ret >= 0) {
int statret;
- struct page *page = NULL;
+ struct folio *folio = NULL;
loff_t i_size;
if (retry_op == READ_INLINE) {
- page = __page_cache_alloc(GFP_KERNEL);
- if (!page)
+ folio = filemap_alloc_folio(GFP_KERNEL, 0);
+ if (!folio)
return -ENOMEM;
}
- statret = __ceph_do_getattr(inode, page,
- CEPH_STAT_CAP_INLINE_DATA, !!page);
+ statret = __ceph_do_getattr(inode, &folio->page,
+ CEPH_STAT_CAP_INLINE_DATA, !!folio);
if (statret < 0) {
- if (page)
- __free_page(page);
+ if (folio)
+ folio_put(folio);
if (statret == -ENODATA) {
BUG_ON(retry_op != READ_INLINE);
goto again;
@@ -2112,8 +2112,8 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
iocb->ki_pos + len);
end = min_t(loff_t, end, PAGE_SIZE);
if (statret < end)
- zero_user_segment(page, statret, end);
- ret = copy_page_to_iter(page,
+ folio_zero_segment(folio, statret, end);
+ ret = copy_folio_to_iter(folio,
iocb->ki_pos & ~PAGE_MASK,
end - iocb->ki_pos, to);
iocb->ki_pos += ret;
@@ -2126,7 +2126,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
iocb->ki_pos += ret;
read += ret;
}
- __free_pages(page, 0);
+ folio_put(folio);
return read;
}
Use the folio APIs instead of the page APIs. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- fs/ceph/file.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)