summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorNikolay Borisov <n.borisov.lkml@gmail.com>2017-02-20 13:50:46 +0200
committerDavid Sterba <dsterba@suse.com>2017-02-28 11:30:08 +0100
commit35339c245b5939315e8763deb7f9b68fffe54912 (patch)
tree4cdbec4c5d390125d896907743ad6882ffd7c721 /fs/btrfs/file.c
parentdcdbc059f01e242f92e3239654a1a57d15b0da5a (diff)
downloadlinux-35339c245b5939315e8763deb7f9b68fffe54912.tar.gz
linux-35339c245b5939315e8763deb7f9b68fffe54912.tar.bz2
linux-35339c245b5939315e8763deb7f9b68fffe54912.zip
btrfs: Make hole_mergeable take btrfs_inode
Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 5df1de43aace..27dfdfb7ff19 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2195,7 +2195,7 @@ static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma)
return 0;
}
-static int hole_mergeable(struct inode *inode, struct extent_buffer *leaf,
+static int hole_mergeable(struct btrfs_inode *inode, struct extent_buffer *leaf,
int slot, u64 start, u64 end)
{
struct btrfs_file_extent_item *fi;
@@ -2205,7 +2205,7 @@ static int hole_mergeable(struct inode *inode, struct extent_buffer *leaf,
return 0;
btrfs_item_key_to_cpu(leaf, &key, slot);
- if (key.objectid != btrfs_ino(BTRFS_I(inode)) ||
+ if (key.objectid != btrfs_ino(inode) ||
key.type != BTRFS_EXTENT_DATA_KEY)
return 0;
@@ -2255,7 +2255,8 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode,
}
leaf = path->nodes[0];
- if (hole_mergeable(inode, leaf, path->slots[0]-1, offset, end)) {
+ if (hole_mergeable(BTRFS_I(inode), leaf, path->slots[0] - 1,
+ offset, end)) {
u64 num_bytes;
path->slots[0]--;
@@ -2270,7 +2271,7 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode,
goto out;
}
- if (hole_mergeable(inode, leaf, path->slots[0], offset, end)) {
+ if (hole_mergeable(BTRFS_I(inode), leaf, path->slots[0], offset, end)) {
u64 num_bytes;
key.offset = offset;