udf: Use a folio in udf_write_end()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 17 Apr 2024 15:04:13 +0000 (16:04 +0100)
committerJan Kara <jack@suse.cz>
Tue, 23 Apr 2024 13:37:02 +0000 (15:37 +0200)
Convert the page to a folio and use the folio APIs.  Replaces three
calls to compound_head() with one.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20240417150416.752929-8-willy@infradead.org>

fs/udf/inode.c

index d345621565225c674c81a9a6c8e49d6467b3975b..2fb21c5ffccfe477d85398a74df72005b10cbe6a 100644 (file)
@@ -276,17 +276,19 @@ static int udf_write_end(struct file *file, struct address_space *mapping,
                         struct page *page, void *fsdata)
 {
        struct inode *inode = file_inode(file);
+       struct folio *folio;
        loff_t last_pos;
 
        if (UDF_I(inode)->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB)
                return generic_write_end(file, mapping, pos, len, copied, page,
                                         fsdata);
+       folio = page_folio(page);
        last_pos = pos + copied;
        if (last_pos > inode->i_size)
                i_size_write(inode, last_pos);
-       set_page_dirty(page);
-       unlock_page(page);
-       put_page(page);
+       folio_mark_dirty(folio);
+       folio_unlock(folio);
+       folio_put(folio);
 
        return copied;
 }