|
2 | 2 | dnl # Check for generic io accounting interface.
|
3 | 3 | dnl #
|
4 | 4 | AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
| 5 | + ZFS_LINUX_TEST_SRC([disk_io_acct], [ |
| 6 | + #include <linux/blkdev.h> |
| 7 | + ], [ |
| 8 | + struct gendisk *disk = NULL; |
| 9 | + struct bio *bio = NULL; |
| 10 | + unsigned long start_time; |
| 11 | +
|
| 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); |
| 14 | + ]) |
| 15 | +
|
5 | 16 | ZFS_LINUX_TEST_SRC([bio_io_acct], [
|
6 | 17 | #include <linux/blkdev.h>
|
7 | 18 | ], [
|
@@ -39,48 +50,62 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
39 | 50 |
|
40 | 51 | AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
41 | 52 | dnl #
|
42 |
| - dnl # 5.7 API, |
| 53 | + dnl # 5.12 API, |
43 | 54 | dnl #
|
44 |
| - dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers. |
| 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 |
45 | 57 | dnl #
|
46 |
| - AC_MSG_CHECKING([whether generic bio_*_io_acct() are available]) |
47 |
| - ZFS_LINUX_TEST_RESULT([bio_io_acct], [ |
| 58 | + AC_MSG_CHECKING([whether generic disk_*_io_acct() are available]) |
| 59 | + ZFS_LINUX_TEST_RESULT([disk_io_acct], [ |
48 | 60 | AC_MSG_RESULT(yes)
|
49 |
| - AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available]) |
| 61 | + AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available]) |
50 | 62 | ], [
|
51 | 63 | AC_MSG_RESULT(no)
|
52 | 64 |
|
53 | 65 | dnl #
|
54 |
| - dnl # 4.14 API, |
| 66 | + dnl # 5.7 API, |
55 | 67 | dnl #
|
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. |
| 68 | + dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers. |
59 | 69 | dnl #
|
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], [ |
| 70 | + AC_MSG_CHECKING([whether generic bio_*_io_acct() are available]) |
| 71 | + ZFS_LINUX_TEST_RESULT([bio_io_acct], [ |
63 | 72 | AC_MSG_RESULT(yes)
|
64 |
| - AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1, |
65 |
| - [generic_*_io_acct() 4 arg available]) |
| 73 | + AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available]) |
66 | 74 | ], [
|
67 | 75 | AC_MSG_RESULT(no)
|
68 | 76 |
|
69 | 77 | dnl #
|
70 |
| - dnl # 3.19 API addition |
| 78 | + dnl # 4.14 API, |
71 | 79 | dnl #
|
72 |
| - dnl # torvalds/linux@394ffa50 allows us to increment |
73 |
| - dnl # iostat counters without generic_make_request(). |
| 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. |
74 | 83 | dnl #
|
75 |
| - AC_MSG_CHECKING( |
76 |
| - [whether generic_*_io_acct wants 3 args]) |
77 |
| - ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args], |
| 84 | + AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args]) |
| 85 | + ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args], |
78 | 86 | [generic_start_io_acct], [block/bio.c], [
|
79 | 87 | AC_MSG_RESULT(yes)
|
80 |
| - AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1, |
81 |
| - [generic_*_io_acct() 3 arg available]) |
| 88 | + AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1, |
| 89 | + [generic_*_io_acct() 4 arg available]) |
82 | 90 | ], [
|
83 | 91 | AC_MSG_RESULT(no)
|
| 92 | +
|
| 93 | + dnl # |
| 94 | + dnl # 3.19 API addition |
| 95 | + dnl # |
| 96 | + dnl # torvalds/linux@394ffa50 allows us to increment |
| 97 | + dnl # iostat counters without generic_make_request(). |
| 98 | + dnl # |
| 99 | + AC_MSG_CHECKING( |
| 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], [ |
| 103 | + AC_MSG_RESULT(yes) |
| 104 | + AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1, |
| 105 | + [generic_*_io_acct() 3 arg available]) |
| 106 | + ], [ |
| 107 | + AC_MSG_RESULT(no) |
| 108 | + ]) |
84 | 109 | ])
|
85 | 110 | ])
|
86 | 111 | ])
|
|
0 commit comments