2 dnl # Check for generic io accounting interface.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
5 ZFS_LINUX_TEST_SRC([bio_io_acct], [
6 #include <linux/blkdev.h>
8 struct bio *bio = NULL;
9 unsigned long start_time;
11 start_time = bio_start_io_acct(bio);
12 bio_end_io_acct(bio, start_time);
15 ZFS_LINUX_TEST_SRC([generic_acct_3args], [
16 #include <linux/bio.h>
18 void (*generic_start_io_acct_f)(int, unsigned long,
19 struct hd_struct *) = &generic_start_io_acct;
20 void (*generic_end_io_acct_f)(int, struct hd_struct *,
21 unsigned long) = &generic_end_io_acct;
23 generic_start_io_acct(0, 0, NULL);
24 generic_end_io_acct(0, NULL, 0);
27 ZFS_LINUX_TEST_SRC([generic_acct_4args], [
28 #include <linux/bio.h>
30 void (*generic_start_io_acct_f)(struct request_queue *, int,
31 unsigned long, struct hd_struct *) = &generic_start_io_acct;
32 void (*generic_end_io_acct_f)(struct request_queue *, int,
33 struct hd_struct *, unsigned long) = &generic_end_io_acct;
35 generic_start_io_acct(NULL, 0, 0, NULL);
36 generic_end_io_acct(NULL, 0, NULL, 0);
40 AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
44 dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
46 AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
47 ZFS_LINUX_TEST_RESULT([bio_io_acct], [
49 AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
56 dnl # generic_start_io_acct/generic_end_io_acct now require
57 dnl # request_queue to be provided. No functional changes,
58 dnl # but preparation for inflight accounting.
60 AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
61 ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
62 [generic_start_io_acct], [block/bio.c], [
64 AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
65 [generic_*_io_acct() 4 arg available])
70 dnl # 3.19 API addition
72 dnl # torvalds/linux@394ffa50 allows us to increment
73 dnl # iostat counters without generic_make_request().
76 [whether generic_*_io_acct wants 3 args])
77 ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
78 [generic_start_io_acct], [block/bio.c], [
80 AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
81 [generic_*_io_acct() 3 arg available])