summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorNikolay Borisov <n.borisov.lkml@gmail.com>2017-02-20 13:50:45 +0200
committerDavid Sterba <dsterba@suse.com>2017-02-28 11:30:08 +0100
commitdcdbc059f01e242f92e3239654a1a57d15b0da5a (patch)
tree90fa268aa45d18f0ac8dcc2189e525818d3c2413 /fs/btrfs/file.c
parent46e59791836c75210bdf1f715592b49836fad848 (diff)
downloadlinux-dcdbc059f01e242f92e3239654a1a57d15b0da5a.tar.bz2
btrfs: Make btrfs_drop_extent_cache 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index dd1b56504e10..5df1de43aace 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -529,13 +529,13 @@ int btrfs_dirty_pages(struct inode *inode, struct page **pages,
* this drops all the extents in the cache that intersect the range
* [start, end]. Existing extents are split as required.
*/
-void btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
+void btrfs_drop_extent_cache(struct btrfs_inode *inode, u64 start, u64 end,
int skip_pinned)
{
struct extent_map *em;
struct extent_map *split = NULL;
struct extent_map *split2 = NULL;
- struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
+ struct extent_map_tree *em_tree = &inode->extent_tree;
u64 len = end - start + 1;
u64 gen;
int ret;
@@ -720,7 +720,7 @@ int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
int leafs_visited = 0;
if (drop_cache)
- btrfs_drop_extent_cache(inode, start, end - 1, 0);
+ btrfs_drop_extent_cache(BTRFS_I(inode), start, end - 1, 0);
if (start >= BTRFS_I(inode)->disk_i_size && !replace_extent)
modify_tree = 0;
@@ -2297,7 +2297,7 @@ out:
hole_em = alloc_extent_map();
if (!hole_em) {
- btrfs_drop_extent_cache(inode, offset, end - 1, 0);
+ btrfs_drop_extent_cache(BTRFS_I(inode), offset, end - 1, 0);
set_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
&BTRFS_I(inode)->runtime_flags);
} else {
@@ -2314,7 +2314,8 @@ out:
hole_em->generation = trans->transid;
do {
- btrfs_drop_extent_cache(inode, offset, end - 1, 0);
+ btrfs_drop_extent_cache(BTRFS_I(inode), offset,
+ end - 1, 0);
write_lock(&em_tree->lock);
ret = add_extent_mapping(em_tree, hole_em, 1);
write_unlock(&em_tree->lock);