btrfs: don't clear page->mapping in btrfs_free_compressed_pages
authorChristoph Hellwig <hch@lst.de>
Fri, 10 Feb 2023 07:48:40 +0000 (08:48 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:15 +0000 (18:01 +0200)
No one ever set ->mapping on these pages, so don't bother clearing it.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c

index 5f64a77..6a23d6c 100644 (file)
@@ -161,12 +161,8 @@ static int compression_decompress(int type, struct list_head *ws,
 
 static void btrfs_free_compressed_pages(struct compressed_bio *cb)
 {
-       for (unsigned int i = 0; i < cb->nr_pages; i++) {
-               struct page *page = cb->compressed_pages[i];
-
-               page->mapping = NULL;
-               put_page(page);
-       }
+       for (unsigned int i = 0; i < cb->nr_pages; i++)
+               put_page(cb->compressed_pages[i]);
        kfree(cb->compressed_pages);
 }