diff options
author | Alex Gartrell <agartrell@fb.com> | 2014-05-20 16:07:56 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-06-09 20:20:57 -0400 |
commit | fc4adbff823f76577ece26dcb88bf6f8392dbd43 (patch) | |
tree | d3708c9b2f6e3023a7da4452d90f65e99a007213 /fs/btrfs/file.c | |
parent | 0e378df15cd87f540f1ba9503e4aa039e1c72741 (diff) |
btrfs: Drop EXTENT_UPTODATE check in hole punching and direct locking
In these instances, we are trying to determine if a page has been accessed
since we began the operation for the sake of retry. This is easily
accomplished by doing a gang lookup in the page mapping radix tree, and it
saves us the dependency on the flag (so that we might eventually delete
it).
btrfs_page_exists_in_range borrows heavily from find_get_page, replacing
the radix tree look up with a gang lookup of 1, so that we can find the
next highest page >= index and see if it falls into our lock range.
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Alex Gartrell <agartrell@fb.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 8accf94ef220..e46bfaf6cde2 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -2266,9 +2266,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) | |||
2266 | if ((!ordered || | 2266 | if ((!ordered || |
2267 | (ordered->file_offset + ordered->len <= lockstart || | 2267 | (ordered->file_offset + ordered->len <= lockstart || |
2268 | ordered->file_offset > lockend)) && | 2268 | ordered->file_offset > lockend)) && |
2269 | !test_range_bit(&BTRFS_I(inode)->io_tree, lockstart, | 2269 | !btrfs_page_exists_in_range(inode, lockstart, lockend)) { |
2270 | lockend, EXTENT_UPTODATE, 0, | ||
2271 | cached_state)) { | ||
2272 | if (ordered) | 2270 | if (ordered) |
2273 | btrfs_put_ordered_extent(ordered); | 2271 | btrfs_put_ordered_extent(ordered); |
2274 | break; | 2272 | break; |