This makes it possible for callers to check for extent_buffers in cache
without deadlocking against any btree locks held.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
int err = 0;
if (!pending) {
int err = 0;
if (!pending) {
struct extent_buffer *buf;
buf = btrfs_find_tree_block(root, bytenr, num_bytes);
if (buf) {
struct extent_buffer *buf;
buf = btrfs_find_tree_block(root, bytenr, num_bytes);
if (buf) {
}
free_extent_buffer(buf);
}
}
free_extent_buffer(buf);
}
update_pinned_extents(root, bytenr, num_bytes, 1);
} else {
set_extent_bits(&root->fs_info->pending_del,
update_pinned_extents(root, bytenr, num_bytes, 1);
} else {
set_extent_bits(&root->fs_info->pending_del,
goto lru_add;
for (i = 0; i < num_pages; i++, index++) {
goto lru_add;
for (i = 0; i < num_pages; i++, index++) {
- p = find_lock_page(mapping, index);
+ p = find_get_page(mapping, index);
+ if (TestSetPageLocked(p)) {
+ page_cache_release(p);
+ goto fail;
+ }
+
set_page_extent_mapped(p);
mark_page_accessed(p);
set_page_extent_mapped(p);
mark_page_accessed(p);