mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
block: remove per-queue plugging
Code has been converted over to the new explicit on-stack plugging, and delay users have been converted to use the new API for that. So lets kill off the old plugging along with aops->sync_page(). Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
73c1010119
commit
7eaceaccab
119 changed files with 151 additions and 1269 deletions
|
@ -847,7 +847,6 @@ static const struct address_space_operations btree_aops = {
|
|||
.writepages = btree_writepages,
|
||||
.releasepage = btree_releasepage,
|
||||
.invalidatepage = btree_invalidatepage,
|
||||
.sync_page = block_sync_page,
|
||||
#ifdef CONFIG_MIGRATION
|
||||
.migratepage = btree_migratepage,
|
||||
#endif
|
||||
|
@ -1330,82 +1329,6 @@ static int btrfs_congested_fn(void *congested_data, int bdi_bits)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* this unplugs every device on the box, and it is only used when page
|
||||
* is null
|
||||
*/
|
||||
static void __unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
|
||||
{
|
||||
struct btrfs_device *device;
|
||||
struct btrfs_fs_info *info;
|
||||
|
||||
info = (struct btrfs_fs_info *)bdi->unplug_io_data;
|
||||
list_for_each_entry(device, &info->fs_devices->devices, dev_list) {
|
||||
if (!device->bdev)
|
||||
continue;
|
||||
|
||||
bdi = blk_get_backing_dev_info(device->bdev);
|
||||
if (bdi->unplug_io_fn)
|
||||
bdi->unplug_io_fn(bdi, page);
|
||||
}
|
||||
}
|
||||
|
||||
static void btrfs_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
|
||||
{
|
||||
struct inode *inode;
|
||||
struct extent_map_tree *em_tree;
|
||||
struct extent_map *em;
|
||||
struct address_space *mapping;
|
||||
u64 offset;
|
||||
|
||||
/* the generic O_DIRECT read code does this */
|
||||
if (1 || !page) {
|
||||
__unplug_io_fn(bdi, page);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* page->mapping may change at any time. Get a consistent copy
|
||||
* and use that for everything below
|
||||
*/
|
||||
smp_mb();
|
||||
mapping = page->mapping;
|
||||
if (!mapping)
|
||||
return;
|
||||
|
||||
inode = mapping->host;
|
||||
|
||||
/*
|
||||
* don't do the expensive searching for a small number of
|
||||
* devices
|
||||
*/
|
||||
if (BTRFS_I(inode)->root->fs_info->fs_devices->open_devices <= 2) {
|
||||
__unplug_io_fn(bdi, page);
|
||||
return;
|
||||
}
|
||||
|
||||
offset = page_offset(page);
|
||||
|
||||
em_tree = &BTRFS_I(inode)->extent_tree;
|
||||
read_lock(&em_tree->lock);
|
||||
em = lookup_extent_mapping(em_tree, offset, PAGE_CACHE_SIZE);
|
||||
read_unlock(&em_tree->lock);
|
||||
if (!em) {
|
||||
__unplug_io_fn(bdi, page);
|
||||
return;
|
||||
}
|
||||
|
||||
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
||||
free_extent_map(em);
|
||||
__unplug_io_fn(bdi, page);
|
||||
return;
|
||||
}
|
||||
offset = offset - em->start;
|
||||
btrfs_unplug_page(&BTRFS_I(inode)->root->fs_info->mapping_tree,
|
||||
em->block_start + offset, page);
|
||||
free_extent_map(em);
|
||||
}
|
||||
|
||||
/*
|
||||
* If this fails, caller must call bdi_destroy() to get rid of the
|
||||
* bdi again.
|
||||
|
@ -1420,8 +1343,6 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi)
|
|||
return err;
|
||||
|
||||
bdi->ra_pages = default_backing_dev_info.ra_pages;
|
||||
bdi->unplug_io_fn = btrfs_unplug_io_fn;
|
||||
bdi->unplug_io_data = info;
|
||||
bdi->congested_fn = btrfs_congested_fn;
|
||||
bdi->congested_data = info;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue