]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
jffs2: Pass the file pointer to jffs2_do_readpage_unlock()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 1 May 2022 23:39:03 +0000 (19:39 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 9 May 2022 20:28:41 +0000 (16:28 -0400)
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) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/jffs2/file.c
fs/jffs2/gc.c

index f8616683fbee823bac8ac9906ab012dcd134f6a2..492fb2da04039eee86765ec2c3fe69293f195194 100644 (file)
@@ -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;
 }
index 373b3b7c9f44570ed523332720e116556805214f..a53bac7569b6b5e0c7382cca427462e432a8e6c5 100644 (file)
@@ -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));