aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2019-12-02 17:34:22 -0800
committerDavid Sterba <dsterba@suse.com>2020-01-20 16:40:55 +0100
commitf95d713b540487901871f90512f01f2fb3e6dfaa (patch)
tree9cf3e6a7167c8724ade342fd8eb0ffebcde1cccd /fs/btrfs/ctree.h
parentbtrfs: remove trivial goto label in __extent_writepage() (diff)
downloadlinux-dev-f95d713b540487901871f90512f01f2fb3e6dfaa.tar.xz
linux-dev-f95d713b540487901871f90512f01f2fb3e6dfaa.zip
btrfs: remove redundant i_size check in __extent_writepage_io()
In __extent_writepage_io(), we check whether i_size <= page_offset(page). Note that if i_size < page_offset(page), then i_size >> PAGE_SHIFT < page->index. If i_size == page_offset(page), then i_size >> PAGE_SHIFT == page->index && offset_in_page(i_size) == 0. __extent_writepage() already has a check for these cases that returns without calling __extent_writepage_io(): end_index = i_size >> PAGE_SHIFT pg_offset = offset_in_page(i_size); if (page->index > end_index || (page->index == end_index && !pg_offset)) { page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE); unlock_page(page); return 0; } Get rid of the one in __extent_writepage_io(), which was obsoleted in 211c17f51f46 ("Fix corners in writepage and btrfs_truncate_page"). Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
0 files changed, 0 insertions, 0 deletions