OSDN Git Service

btrfs: get bdev directly from fs_devices in submit_extent_page
authorDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 22:27:55 +0000 (23:27 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 22:38:46 +0000 (23:38 +0100)
commit429aebc0a9a063667dba21244386f96e5b4d7330
tree9e1447189619752d8851a176167b2074df992553
parent3e1740993e43116b3bc71b0aad1e6872f6ccf341
btrfs: get bdev directly from fs_devices in submit_extent_page

This is preparatory patch to remove @bdev parameter from
submit_extent_page. It can't be removed completely, because the cgroups
need it for wbc when initializing the bio

wbc_init_bio
  bio_associate_blkg_from_css
    dereference bdev->bi_disk->queue

The bdev pointer is the same as latest_bdev, thus no functional change.
We can retrieve it from fs_devices that's reachable through several
dereferences. The local variable shadows the parameter, but that's only
temporary.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c