2022-05-02 17:09:03

by Matthew Wilcox

[permalink] [raw]
Subject: [PATCH 0/3] Unify filler_t and read_folio

I realised there was no good reason for any of the three filesystems which
actually use read_cache_page() to pass in something that wasn't a struct
file pointer. Indeed, it made each of them more complex. These aren't
filesystems I test regularly, so please scrutinise carefully. This is
on top of the read_folio() patchset that I posted recently and can be
found at git://git.infradead.org/users/willy/pagecache.git for-next

Matthew Wilcox (Oracle) (3):
jffs2: Pass the file pointer to jffs2_do_readpage_unlock()
nfs: Pass the file pointer to nfs_symlink_filler()
fs: Change the type of filler_t

fs/gfs2/aops.c | 29 +++++++++++------------------
fs/jffs2/file.c | 9 ++++-----
fs/jffs2/gc.c | 2 +-
fs/jffs2/os-linux.h | 2 +-
fs/nfs/symlink.c | 16 ++++++++--------
include/linux/pagemap.h | 6 +++---
mm/filemap.c | 40 ++++++++++++++++++++--------------------
7 files changed, 48 insertions(+), 56 deletions(-)

--
2.34.1


2022-05-02 20:04:36

by Matthew Wilcox

[permalink] [raw]
Subject: [PATCH 1/3] jffs2: Pass the file pointer to jffs2_do_readpage_unlock()

In preparation for unifying the read_cache_page() and read_folio()
implementations, make jffs2_do_readpage_unlock() get the inode
from the page instead of passing it in from read_cache_page().

Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
---
fs/jffs2/file.c | 4 ++--
fs/jffs2/gc.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index f8616683fbee..492fb2da0403 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -112,7 +112,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)

int jffs2_do_readpage_unlock(void *data, struct page *pg)
{
- int ret = jffs2_do_readpage_nolock(data, pg);
+ int ret = jffs2_do_readpage_nolock(pg->mapping->host, pg);
unlock_page(pg);
return ret;
}
@@ -124,7 +124,7 @@ static int jffs2_read_folio(struct file *file, struct folio *folio)
int ret;

mutex_lock(&f->sem);
- ret = jffs2_do_readpage_unlock(folio->mapping->host, &folio->page);
+ ret = jffs2_do_readpage_unlock(file, &folio->page);
mutex_unlock(&f->sem);
return ret;
}
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 373b3b7c9f44..a53bac7569b6 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -1327,7 +1327,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
* trying to write out, read_cache_page() will not deadlock. */
mutex_unlock(&f->sem);
page = read_cache_page(inode->i_mapping, start >> PAGE_SHIFT,
- jffs2_do_readpage_unlock, inode);
+ jffs2_do_readpage_unlock, NULL);
if (IS_ERR(page)) {
pr_warn("read_cache_page() returned error: %ld\n",
PTR_ERR(page));
--
2.34.1