]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: remove redundant calls to flush_dcache_page
authorDavid Sterba <dsterba@suse.com>
Wed, 1 Jun 2022 11:47:54 +0000 (13:47 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:34 +0000 (17:44 +0200)
Both memzero_page and memcpy_to_page already call flush_dcache_page so
we can remove the calls from btrfs code.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/reflink.c

index 6ab82e142f1f86bca5e92d2c76340a78cfa459e8..2536754656b6655c5c7f9588624d3c41c9b038bf 100644 (file)
@@ -760,7 +760,6 @@ static noinline int add_ra_bio_pages(struct inode *inode,
                                int zeros;
                                zeros = PAGE_SIZE - zero_offset;
                                memzero_page(page, zero_offset, zeros);
-                               flush_dcache_page(page);
                        }
                }
 
@@ -1476,7 +1475,6 @@ int btrfs_decompress_buf2page(const char *buf, u32 buf_len,
                ASSERT(copy_start - decompressed < buf_len);
                memcpy_to_page(bvec.bv_page, bvec.bv_offset,
                               buf + copy_start - decompressed, copy_len);
-               flush_dcache_page(bvec.bv_page);
                cur_offset += copy_len;
 
                bio_advance(orig_bio, copy_len);
index 62425d1494a90df4094d129a50cfeec3f69ec573..69b6b4ba009e470ef21e0eb72e563001222975f0 100644 (file)
@@ -3641,7 +3641,6 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached,
                if (zero_offset) {
                        iosize = PAGE_SIZE - zero_offset;
                        memzero_page(page, zero_offset, iosize);
-                       flush_dcache_page(page);
                }
        }
        begin_page_read(fs_info, page);
@@ -3656,7 +3655,6 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached,
 
                        iosize = PAGE_SIZE - pg_offset;
                        memzero_page(page, pg_offset, iosize);
-                       flush_dcache_page(page);
                        set_extent_uptodate(tree, cur, cur + iosize - 1,
                                            &cached, GFP_NOFS);
                        unlock_extent_cached(tree, cur,
@@ -3740,7 +3738,6 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached,
                        struct extent_state *cached = NULL;
 
                        memzero_page(page, pg_offset, iosize);
-                       flush_dcache_page(page);
 
                        set_extent_uptodate(tree, cur, cur + iosize - 1,
                                            &cached, GFP_NOFS);
@@ -4158,10 +4155,8 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
                return 0;
        }
 
-       if (page->index == end_index) {
+       if (page->index == end_index)
                memzero_page(page, pg_offset, PAGE_SIZE - pg_offset);
-               flush_dcache_page(page);
-       }
 
        ret = set_page_extent_mapped(page);
        if (ret < 0) {
index 76e493e2d9b28afae2f4165417e7794d463aa48a..f96e332bfe963d4de934cc0d69cd60a743a0aac6 100644 (file)
@@ -4873,7 +4873,6 @@ again:
                else
                        memzero_page(page, (block_start - page_offset(page)) + offset,
                                     len);
-               flush_dcache_page(page);
        }
        btrfs_page_clear_checked(fs_info, page, block_start,
                                 block_end + 1 - block_start);
@@ -8598,10 +8597,9 @@ again:
        else
                zero_start = PAGE_SIZE;
 
-       if (zero_start != PAGE_SIZE) {
+       if (zero_start != PAGE_SIZE)
                memzero_page(page, zero_start, PAGE_SIZE - zero_start);
-               flush_dcache_page(page);
-       }
+
        btrfs_page_clear_checked(fs_info, page, page_start, PAGE_SIZE);
        btrfs_page_set_dirty(fs_info, page, page_start, end + 1 - page_start);
        btrfs_page_set_uptodate(fs_info, page, page_start, end + 1 - page_start);
index a3549d587464af4b43f0019cb94f343ee0d02cee..e30f53bd4e558170fa8bc78d84f2e873623449ef 100644 (file)
@@ -110,7 +110,6 @@ static int copy_inline_to_page(struct btrfs_inode *inode,
        if (comp_type == BTRFS_COMPRESS_NONE) {
                memcpy_to_page(page, offset_in_page(file_offset), data_start,
                               datal);
-               flush_dcache_page(page);
        } else {
                ret = btrfs_decompress(comp_type, data_start, page,
                                       offset_in_page(file_offset),
@@ -132,10 +131,8 @@ static int copy_inline_to_page(struct btrfs_inode *inode,
         *
         * So what's in the range [500, 4095] corresponds to zeroes.
         */
-       if (datal < block_size) {
+       if (datal < block_size)
                memzero_page(page, datal, block_size - datal);
-               flush_dcache_page(page);
-       }
 
        btrfs_page_set_uptodate(fs_info, page, file_offset, block_size);
        btrfs_page_clear_checked(fs_info, page, file_offset, block_size);