aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index f89396082544..b0352b5958a5 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -357,10 +357,13 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end)
357{ 357{
358 struct extent_map *em; 358 struct extent_map *em;
359 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; 359 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
360 u64 len = end - start + 1;
360 361
362 if (end == (u64)-1)
363 len = (u64)-1;
361 while(1) { 364 while(1) {
362 spin_lock(&em_tree->lock); 365 spin_lock(&em_tree->lock);
363 em = lookup_extent_mapping(em_tree, start, end); 366 em = lookup_extent_mapping(em_tree, start, len);
364 if (!em) { 367 if (!em) {
365 spin_unlock(&em_tree->lock); 368 spin_unlock(&em_tree->lock);
366 break; 369 break;