From 787acae0b5cd139ea0f9fa60558cca28d4673b23 Mon Sep 17 00:00:00 2001 From: Giuseppe Di Natale Date: Sat, 16 Sep 2017 11:00:19 -0700 Subject: 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 Signed-off-by: Giuseppe Di Natale Closes #6635 --- include/linux/blkdev_compat.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index 428664a0b..c8a8e856d 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -598,16 +598,26 @@ blk_queue_discard_granularity(struct request_queue *q, unsigned int dg) */ #define VDEV_HOLDER ((void *)0x2401de7) -#ifndef HAVE_GENERIC_IO_ACCT static inline void -generic_start_io_acct(int rw, unsigned long sectors, struct hd_struct *part) +blk_generic_start_io_acct(struct request_queue *q, int rw, + unsigned long sectors, struct hd_struct *part) { +#if defined(HAVE_GENERIC_IO_ACCT_3ARG) + generic_start_io_acct(rw, sectors, part); +#elif defined(HAVE_GENERIC_IO_ACCT_4ARG) + generic_start_io_acct(q, rw, sectors, part); +#endif } static inline void -generic_end_io_acct(int rw, struct hd_struct *part, unsigned long start_time) +blk_generic_end_io_acct(struct request_queue *q, int rw, + struct hd_struct *part, unsigned long start_time) { -} +#if defined(HAVE_GENERIC_IO_ACCT_3ARG) + generic_end_io_acct(rw, part, start_time); +#elif defined(HAVE_GENERIC_IO_ACCT_4ARG) + generic_end_io_acct(q, rw, part, start_time); #endif +} #endif /* _ZFS_BLKDEV_H */ -- cgit v1.2.3