diff options
author | Giuseppe Di Natale <[email protected]> | 2017-09-16 11:00:19 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-09-16 11:00:19 -0700 |
commit | 787acae0b5cd139ea0f9fa60558cca28d4673b23 (patch) | |
tree | 08561030aefd7cab9e4bf07abdcf23be83078ef5 /module/zfs/vdev_disk.c | |
parent | 90cdf2833d163dd4db31aded1e6940cc9edb67f6 (diff) |
Linux 3.14 compat: IO acct, global_page_state, etc
generic_start_io_acct/generic_end_io_acct in the master
branch of the linux kernel requires that the request_queue
be provided.
Move the logic from freemem in the spl to arc_free_memory
in arc.c. Do this so we can take advantage of global_page_state
interface checks in zfs.
Upstream kernel replaced struct block_device with
struct gendisk in struct bio. Determine if the
function bio_set_dev exists during configure
and have zfs use that if it exists.
bio_set_dev https://github.com/torvalds/linux/commit/74d4699
global_node_page_state https://github.com/torvalds/linux/commit/75ef718
io acct https://github.com/torvalds/linux/commit/d62e26b
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Giuseppe Di Natale <[email protected]>
Closes #6635
Diffstat (limited to 'module/zfs/vdev_disk.c')
-rw-r--r-- | module/zfs/vdev_disk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index c6bb24a33..87cc2c892 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -503,6 +503,14 @@ vdev_submit_bio_impl(struct bio *bio) #endif } +#ifndef HAVE_BIO_SET_DEV +static inline void +bio_set_dev(struct bio *bio, struct block_device *bdev) +{ + bio->bi_bdev = bdev; +} +#endif /* !HAVE_BIO_SET_DEV */ + static inline void vdev_submit_bio(struct bio *bio) { @@ -585,7 +593,7 @@ retry: /* Matching put called by vdev_disk_physio_completion */ vdev_disk_dio_get(dr); - dr->dr_bio[i]->bi_bdev = bdev; + bio_set_dev(dr->dr_bio[i], bdev); BIO_BI_SECTOR(dr->dr_bio[i]) = bio_offset >> 9; dr->dr_bio[i]->bi_end_io = vdev_disk_physio_completion; dr->dr_bio[i]->bi_private = dr; @@ -659,7 +667,7 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio) bio->bi_end_io = vdev_disk_io_flush_completion; bio->bi_private = zio; - bio->bi_bdev = bdev; + bio_set_dev(bio, bdev); bio_set_flush(bio); vdev_submit_bio(bio); invalidate_bdev(bdev); |