summaryrefslogtreecommitdiffstats
path: root/include/linux
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 /include/linux
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 'include/linux')
-rw-r--r--include/linux/blkdev_compat.h18
1 files changed, 14 insertions, 4 deletions
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 */