btrfs: remove redundant calls to flush_dcache_page
David Sterba
maintainerPATCH 1/1 btrfs: remove redundant calls to flush_dcache_page
memzero_page already calls flush_dcache_page so we can remove the calls from btrfs code.
Signed-off-by David Sterba <[email protected]>
--- fs/btrfs/compression.c | 2 -- fs/btrfs/extent_io.c | 7 +------ fs/btrfs/inode.c | 6 ++---- fs/btrfs/reflink.c | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-)
fs/btrfs/compression.c +0 -2
@@ -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);
fs/btrfs/extent_io.c +1 -6
@@ -3639,7 +3639,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);
@@ -3654,7 +3653,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,
@@ -3738,7 +3736,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 );
@@ -4156,10 +4153,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 ) {
fs/btrfs/inode.c +2 -4
@@ -4872,7 +4872,6 @@ int btrfs_truncate_block(struct btrfs_inode *inode, loff_t from, loff_t len,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);
@@ -8585,10 +8584,9 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)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);
fs/btrfs/reflink.c +1 -4
@@ -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);
Signature · 1 line
2.36.1
Quoted 2 lines · David Sterba
memzero_pagealready callsflush_dcache_pageso we can remove the calls from btrfs code.
This is for a mix of memcpy_to_page and memzero_page, but the statement is true for both of them. So with a slightly fixed commit log:
Reviewed-by Christoph Hellwig <[email protected]>
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · David Sterba
memzero_pagealready callsflush_dcache_pageso we can remove the calls from btrfs code.This is for a mix of
memcpy_to_pageandmemzero_page, but the statement is true for both of them. So with a slightly fixed commit log:
Right, I'll update it, thanks.