aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zvol.c
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-09-16 11:00:19 -0700
committerBrian Behlendorf <[email protected]>2017-09-16 11:00:19 -0700
commit787acae0b5cd139ea0f9fa60558cca28d4673b23 (patch)
tree08561030aefd7cab9e4bf07abdcf23be83078ef5 /module/zfs/zvol.c
parent90cdf2833d163dd4db31aded1e6940cc9edb67f6 (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/zvol.c')
-rw-r--r--module/zfs/zvol.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index 1cb03fc7e..fe7dbb371 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -761,7 +761,8 @@ zvol_write(void *arg)
ASSERT(zv && zv->zv_open_count > 0);
start_jif = jiffies;
- generic_start_io_acct(WRITE, bio_sectors(bio), &zv->zv_disk->part0);
+ blk_generic_start_io_acct(zv->zv_queue, WRITE, bio_sectors(bio),
+ &zv->zv_disk->part0);
sync = bio_is_fua(bio) || zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS;
@@ -794,7 +795,8 @@ zvol_write(void *arg)
zil_commit(zv->zv_zilog, ZVOL_OBJ);
rw_exit(&zv->zv_suspend_lock);
- generic_end_io_acct(WRITE, &zv->zv_disk->part0, start_jif);
+ blk_generic_end_io_acct(zv->zv_queue, WRITE, &zv->zv_disk->part0,
+ start_jif);
BIO_END_IO(bio, -error);
kmem_free(zvr, sizeof (zv_request_t));
}
@@ -840,7 +842,8 @@ zvol_discard(void *arg)
ASSERT(zv && zv->zv_open_count > 0);
start_jif = jiffies;
- generic_start_io_acct(WRITE, bio_sectors(bio), &zv->zv_disk->part0);
+ blk_generic_start_io_acct(zv->zv_queue, WRITE, bio_sectors(bio),
+ &zv->zv_disk->part0);
sync = bio_is_fua(bio) || zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS;
@@ -881,7 +884,8 @@ unlock:
zil_commit(zv->zv_zilog, ZVOL_OBJ);
rw_exit(&zv->zv_suspend_lock);
- generic_end_io_acct(WRITE, &zv->zv_disk->part0, start_jif);
+ blk_generic_end_io_acct(zv->zv_queue, WRITE, &zv->zv_disk->part0,
+ start_jif);
BIO_END_IO(bio, -error);
kmem_free(zvr, sizeof (zv_request_t));
}
@@ -902,7 +906,8 @@ zvol_read(void *arg)
ASSERT(zv && zv->zv_open_count > 0);
start_jif = jiffies;
- generic_start_io_acct(READ, bio_sectors(bio), &zv->zv_disk->part0);
+ blk_generic_start_io_acct(zv->zv_queue, READ, bio_sectors(bio),
+ &zv->zv_disk->part0);
while (uio.uio_resid > 0 && uio.uio_loffset < volsize) {
uint64_t bytes = MIN(uio.uio_resid, DMU_MAX_ACCESS >> 1);
@@ -922,7 +927,8 @@ zvol_read(void *arg)
zfs_range_unlock(zvr->rl);
rw_exit(&zv->zv_suspend_lock);
- generic_end_io_acct(READ, &zv->zv_disk->part0, start_jif);
+ blk_generic_end_io_acct(zv->zv_queue, READ, &zv->zv_disk->part0,
+ start_jif);
BIO_END_IO(bio, -error);
kmem_free(zvr, sizeof (zv_request_t));
}