jffs2: Convert jffs2 to read_folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 9 May 2022 20:21:45 +0000 (16:21 -0400)
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: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/jffs2/file.c
fs/jffs2/fs.c

index 2b35811772de3c42d7fb5da0ed53de9f2b3726a4..f8616683fbee823bac8ac9906ab012dcd134f6a2 100644 (file)
@@ -27,7 +27,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
 static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
                        loff_t pos, unsigned len,
                        struct page **pagep, void **fsdata);
-static int jffs2_readpage (struct file *filp, struct page *pg);
+static int jffs2_read_folio(struct file *filp, struct folio *folio);
 
 int jffs2_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
 {
@@ -72,7 +72,7 @@ const struct inode_operations jffs2_file_inode_operations =
 
 const struct address_space_operations jffs2_file_address_operations =
 {
-       .readpage =     jffs2_readpage,
+       .read_folio =   jffs2_read_folio,
        .write_begin =  jffs2_write_begin,
        .write_end =    jffs2_write_end,
 };
@@ -118,13 +118,13 @@ int jffs2_do_readpage_unlock(void *data, struct page *pg)
 }
 
 
-static int jffs2_readpage (struct file *filp, struct page *pg)
+static int jffs2_read_folio(struct file *file, struct folio *folio)
 {
-       struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host);
+       struct jffs2_inode_info *f = JFFS2_INODE_INFO(folio->mapping->host);
        int ret;
 
        mutex_lock(&f->sem);
-       ret = jffs2_do_readpage_unlock(pg->mapping->host, pg);
+       ret = jffs2_do_readpage_unlock(folio->mapping->host, &folio->page);
        mutex_unlock(&f->sem);
        return ret;
 }
index 71f03a5d36ed257d4ebd12a49ef54a044e1444b6..00a110f40e10b13d2f439661b749314b5fe07cdd 100644 (file)
@@ -178,7 +178,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
        jffs2_complete_reservation(c);
 
        /* We have to do the truncate_setsize() without f->sem held, since
-          some pages may be locked and waiting for it in readpage().
+          some pages may be locked and waiting for it in read_folio().
           We are protected from a simultaneous write() extending i_size
           back past iattr->ia_size, because do_truncate() holds the
           generic inode semaphore. */