diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2018-03-06 20:23:16 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-31 01:26:45 +0200 |
commit | 965aab1cfc13dacc3d5ad0d8d8eb4e0a7ea8c1d1 (patch) | |
tree | e537073b08d947fba241a8442082c33beb3e772e /fs/btrfs/btrfs_inode.h | |
parent | Btrfs: dev-replace: make sure target is identical to source when raid56 rebui... (diff) | |
download | linux-965aab1cfc13dacc3d5ad0d8d8eb4e0a7ea8c1d1.tar.xz linux-965aab1cfc13dacc3d5ad0d8d8eb4e0a7ea8c1d1.zip |
btrfs: Use filemap_range_has_page()
The current implementation of btrfs_page_exists_in_range() gives the
wrong answer if the workingset code has stored a shadow entry in the
page cache. The filemap_range_has_page() function does not have this
problem, and it's shared code, so use it instead.
eigned-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index f527e99c9f8d..078a53e01ece 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -364,6 +364,10 @@ static inline void btrfs_print_data_csum_error(struct btrfs_inode *inode, logical_start, csum, csum_expected, mirror_num); } -bool btrfs_page_exists_in_range(struct inode *inode, loff_t start, loff_t end); +static inline bool btrfs_page_exists_in_range(struct inode *inode, + loff_t start, loff_t end) +{ + return filemap_range_has_page(inode->i_mapping, start, end); +} #endif |