]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
isofs: Partially convert zisofs_read_folio to use a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 25 Nov 2024 18:01:14 +0000 (18:01 +0000)
committerJan Kara <jack@suse.cz>
Thu, 5 Dec 2024 12:52:37 +0000 (13:52 +0100)
Remove several hidden calls to compound_head() and references
to page->index.  More needs to be done to use folios throughout
the zisofs code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20241125180117.2914311-1-willy@infradead.org
fs/isofs/compress.c

index 34d5baa5d88a003bb22752d51da2744875f81f5a..5f3b6da0e02256cd6a7d0a2471e4e5fa3767639d 100644 (file)
@@ -301,7 +301,6 @@ static int zisofs_fill_pages(struct inode *inode, int full_page, int pcount,
  */
 static int zisofs_read_folio(struct file *file, struct folio *folio)
 {
-       struct page *page = &folio->page;
        struct inode *inode = file_inode(file);
        struct address_space *mapping = inode->i_mapping;
        int err;
@@ -311,16 +310,15 @@ static int zisofs_read_folio(struct file *file, struct folio *folio)
                PAGE_SHIFT <= zisofs_block_shift ?
                (1 << (zisofs_block_shift - PAGE_SHIFT)) : 0;
        struct page **pages;
-       pgoff_t index = page->index, end_index;
+       pgoff_t index = folio->index, end_index;
 
        end_index = (inode->i_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
        /*
-        * If this page is wholly outside i_size we just return zero;
+        * If this folio is wholly outside i_size we just return zero;
         * do_generic_file_read() will handle this for us
         */
        if (index >= end_index) {
-               SetPageUptodate(page);
-               unlock_page(page);
+               folio_end_read(folio, true);
                return 0;
        }
 
@@ -338,10 +336,10 @@ static int zisofs_read_folio(struct file *file, struct folio *folio)
        pages = kcalloc(max_t(unsigned int, zisofs_pages_per_cblock, 1),
                                        sizeof(*pages), GFP_KERNEL);
        if (!pages) {
-               unlock_page(page);
+               folio_unlock(folio);
                return -ENOMEM;
        }
-       pages[full_page] = page;
+       pages[full_page] = &folio->page;
 
        for (i = 0; i < pcount; i++, index++) {
                if (i != full_page)