2 dnl # Check for generic io accounting interface.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
5 ZFS_LINUX_TEST_SRC([disk_io_acct], [
6 #include <linux/blkdev.h>
8 struct gendisk *disk = NULL;
9 struct bio *bio = NULL;
10 unsigned long start_time;
12 start_time = disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio));
13 disk_end_io_acct(disk, bio_op(bio), start_time);
16 ZFS_LINUX_TEST_SRC([bio_io_acct], [
17 #include <linux/blkdev.h>
19 struct bio *bio = NULL;
20 unsigned long start_time;
22 start_time = bio_start_io_acct(bio);
23 bio_end_io_acct(bio, start_time);
26 ZFS_LINUX_TEST_SRC([generic_acct_3args], [
27 #include <linux/bio.h>
29 void (*generic_start_io_acct_f)(int, unsigned long,
30 struct hd_struct *) = &generic_start_io_acct;
31 void (*generic_end_io_acct_f)(int, struct hd_struct *,
32 unsigned long) = &generic_end_io_acct;
34 generic_start_io_acct(0, 0, NULL);
35 generic_end_io_acct(0, NULL, 0);
38 ZFS_LINUX_TEST_SRC([generic_acct_4args], [
39 #include <linux/bio.h>
41 void (*generic_start_io_acct_f)(struct request_queue *, int,
42 unsigned long, struct hd_struct *) = &generic_start_io_acct;
43 void (*generic_end_io_acct_f)(struct request_queue *, int,
44 struct hd_struct *, unsigned long) = &generic_end_io_acct;
46 generic_start_io_acct(NULL, 0, 0, NULL);
47 generic_end_io_acct(NULL, 0, NULL, 0);
51 AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
55 dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported
56 dnl # so use disk_start_io_acct() and disk_end_io_acct() instead
58 AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
59 ZFS_LINUX_TEST_RESULT([disk_io_acct], [
61 AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
68 dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
70 AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
71 ZFS_LINUX_TEST_RESULT([bio_io_acct], [
73 AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
80 dnl # generic_start_io_acct/generic_end_io_acct now require
81 dnl # request_queue to be provided. No functional changes,
82 dnl # but preparation for inflight accounting.
84 AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
85 ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
86 [generic_start_io_acct], [block/bio.c], [
88 AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
89 [generic_*_io_acct() 4 arg available])
94 dnl # 3.19 API addition
96 dnl # torvalds/linux@394ffa50 allows us to increment
97 dnl # iostat counters without generic_make_request().
100 [whether generic_*_io_acct wants 3 args])
101 ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
102 [generic_start_io_acct], [block/bio.c], [
104 AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
105 [generic_*_io_acct() 3 arg available])