]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
btrfs: open code trivial helper btrfs_page_exists_in_range
authorDavid Sterba <dsterba@suse.com>
Wed, 7 Mar 2018 14:33:22 +0000 (15:33 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 23:26:50 +0000 (01:26 +0200)
The called function name is self explanatory.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/file.c
fs/btrfs/inode.c

index 078a53e01ece7fdb3d21f24e59a06163bbe79f58..ca15be569d69c2656c3c7e737b4773c4a6b9d37e 100644 (file)
@@ -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
index 8f425c64d75f14e76b9fad86acf1ee3600705fea..8cac40005e6c43cef43ecd94520565d76b99ed7a 100644 (file)
@@ -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;
index c92455428c013a2d920215daac73ddc1117f03df..fc5b7d82b842305947a759e29238bd24d5026aca 100644 (file)
@@ -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,