summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-07 15:33:22 +0100
committerDavid Sterba <dsterba@suse.com>2018-03-31 01:26:50 +0200
commit051c98eb11e6fd64a8306851c34ee485b5817955 (patch)
tree1e4a90781446147428dccb6aa8b5da11b171079c /fs/btrfs
parent965aab1cfc13dacc3d5ad0d8d8eb4e0a7ea8c1d1 (diff)
downloadblackbird-op-linux-051c98eb11e6fd64a8306851c34ee485b5817955.tar.gz
blackbird-op-linux-051c98eb11e6fd64a8306851c34ee485b5817955.zip
btrfs: open code trivial helper btrfs_page_exists_in_range
The called function name is self explanatory. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/btrfs_inode.h6
-rw-r--r--fs/btrfs/file.c3
-rw-r--r--fs/btrfs/inode.c4
3 files changed, 4 insertions, 9 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 078a53e01ece..ca15be569d69 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -364,10 +364,4 @@ static inline void btrfs_print_data_csum_error(struct btrfs_inode *inode,
logical_start, csum, csum_expected, mirror_num);
}
-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
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 8f425c64d75f..8cac40005e6c 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2482,7 +2482,8 @@ static int btrfs_punch_hole_lock_range(struct inode *inode,
if ((!ordered ||
(ordered->file_offset + ordered->len <= lockstart ||
ordered->file_offset > lockend)) &&
- !btrfs_page_exists_in_range(inode, lockstart, lockend)) {
+ !filemap_range_has_page(inode->i_mapping,
+ lockstart, lockend)) {
if (ordered)
btrfs_put_ordered_extent(ordered);
break;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c92455428c01..fc5b7d82b842 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7489,8 +7489,8 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
* get stale data.
*/
if (!ordered &&
- (!writing ||
- !btrfs_page_exists_in_range(inode, lockstart, lockend)))
+ (!writing || !filemap_range_has_page(inode->i_mapping,
+ lockstart, lockend)))
break;
unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
OpenPOWER on IntegriCloud