ocfs2: Convert ocfs2 to read_folio

This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 933906f8
...@@ -7427,7 +7427,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, ...@@ -7427,7 +7427,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
/* /*
* No need to worry about the data page here - it's been * No need to worry about the data page here - it's been
* truncated already and inline data doesn't need it for * truncated already and inline data doesn't need it for
* pushing zero's to disk, so we'll let readpage pick it up * pushing zero's to disk, so we'll let read_folio pick it up
* later. * later.
*/ */
if (trunc) { if (trunc) {
......
...@@ -275,8 +275,9 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page) ...@@ -275,8 +275,9 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
return ret; return ret;
} }
static int ocfs2_readpage(struct file *file, struct page *page) static int ocfs2_read_folio(struct file *file, struct folio *folio)
{ {
struct page *page = &folio->page;
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
loff_t start = (loff_t)page->index << PAGE_SHIFT; loff_t start = (loff_t)page->index << PAGE_SHIFT;
...@@ -2454,7 +2455,7 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter) ...@@ -2454,7 +2455,7 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
const struct address_space_operations ocfs2_aops = { const struct address_space_operations ocfs2_aops = {
.dirty_folio = block_dirty_folio, .dirty_folio = block_dirty_folio,
.readpage = ocfs2_readpage, .read_folio = ocfs2_read_folio,
.readahead = ocfs2_readahead, .readahead = ocfs2_readahead,
.writepage = ocfs2_writepage, .writepage = ocfs2_writepage,
.write_begin = ocfs2_write_begin, .write_begin = ocfs2_write_begin,
......
...@@ -2526,7 +2526,7 @@ static ssize_t ocfs2_file_read_iter(struct kiocb *iocb, ...@@ -2526,7 +2526,7 @@ static ssize_t ocfs2_file_read_iter(struct kiocb *iocb,
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* /*
* buffered reads protect themselves in ->readpage(). O_DIRECT reads * buffered reads protect themselves in ->read_folio(). O_DIRECT reads
* need locks to protect pending reads from racing with truncate. * need locks to protect pending reads from racing with truncate.
*/ */
if (direct_io) { if (direct_io) {
......
...@@ -52,8 +52,9 @@ ...@@ -52,8 +52,9 @@
#include "buffer_head_io.h" #include "buffer_head_io.h"
static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page) static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
{ {
struct page *page = &folio->page;
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
int status = ocfs2_read_inode_block(inode, &bh); int status = ocfs2_read_inode_block(inode, &bh);
...@@ -81,7 +82,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page) ...@@ -81,7 +82,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
} }
const struct address_space_operations ocfs2_fast_symlink_aops = { const struct address_space_operations ocfs2_fast_symlink_aops = {
.readpage = ocfs2_fast_symlink_readpage, .read_folio = ocfs2_fast_symlink_read_folio,
}; };
const struct inode_operations ocfs2_symlink_inode_operations = { const struct inode_operations ocfs2_symlink_inode_operations = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment