diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-17 11:29:12 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | 3b951516ed703af0f6d82053937655ad69b60864 (patch) | |
tree | 616e648b8683e6bb2996c7ce6bafb8f592244698 /fs/btrfs/extent-tree.c | |
parent | 7b859fe7cd383fa5e7e379884a748680d0af7bcc (diff) |
Btrfs: Use the extent map cache to find the logical disk block during data retries
The data read retry code needs to find the logical disk block before it
can resubmit new bios. But, finding this block isn't allowed to take
the fs_mutex because that will deadlock with a number of different callers.
This changes the retry code to use the extent map cache instead, but
that requires the extent map cache to have the extent we're looking for.
This is a problem because btrfs_drop_extent_cache just drops the entire
extent instead of the little tiny part it is invalidating.
The bulk of the code in this patch changes btrfs_drop_extent_cache to
invalidate only a portion of the extent cache, and changes btrfs_get_extent
to deal with the results.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 76fd5d7146e1..593011e5d455 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1747,6 +1747,7 @@ again: | |||
1747 | search_start, search_end, hint_byte, ins, | 1747 | search_start, search_end, hint_byte, ins, |
1748 | trans->alloc_exclude_start, | 1748 | trans->alloc_exclude_start, |
1749 | trans->alloc_exclude_nr, data); | 1749 | trans->alloc_exclude_nr, data); |
1750 | |||
1750 | if (ret == -ENOSPC && num_bytes > min_alloc_size) { | 1751 | if (ret == -ENOSPC && num_bytes > min_alloc_size) { |
1751 | num_bytes = num_bytes >> 1; | 1752 | num_bytes = num_bytes >> 1; |
1752 | num_bytes = max(num_bytes, min_alloc_size); | 1753 | num_bytes = max(num_bytes, min_alloc_size); |