]>
Commit | Line | Data |
---|---|---|
2404b014 BB |
1 | dnl # |
2 | dnl # 2.6.30 API change | |
3 | dnl # | |
4 | dnl # The bdev_physical_block_size() interface was added to provide a way | |
5 | dnl # to determine the smallest write which can be performed without a | |
6 | dnl # read-modify-write operation. From the kernel documentation: | |
7 | dnl # | |
8 | dnl # What: /sys/block/<disk>/queue/physical_block_size | |
9 | dnl # Date: May 2009 | |
10 | dnl # Contact: Martin K. Petersen <martin.petersen@oracle.com> | |
11 | dnl # Description: | |
12 | dnl # This is the smallest unit the storage device can write | |
13 | dnl # without resorting to read-modify-write operation. It is | |
14 | dnl # usually the same as the logical block size but may be | |
15 | dnl # bigger. One example is SATA drives with 4KB sectors | |
16 | dnl # that expose a 512-byte logical block size to the | |
17 | dnl # operating system. | |
18 | dnl # | |
19 | dnl # Unfortunately, this interface isn't entirely reliable because | |
20 | dnl # drives are sometimes known to misreport this value. | |
21 | dnl # | |
22 | AC_DEFUN([ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE], [ | |
23 | AC_MSG_CHECKING([whether bdev_physical_block_size() is available]) | |
24 | tmp_flags="$EXTRA_KCFLAGS" | |
e191b54e | 25 | EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}" |
2404b014 BB |
26 | ZFS_LINUX_TRY_COMPILE([ |
27 | #include <linux/blkdev.h> | |
28 | ],[ | |
29 | struct block_device *bdev = NULL; | |
30 | bdev_physical_block_size(bdev); | |
31 | ],[ | |
32 | AC_MSG_RESULT(yes) | |
33 | AC_DEFINE(HAVE_BDEV_PHYSICAL_BLOCK_SIZE, 1, | |
34 | [bdev_physical_block_size() is available]) | |
35 | ],[ | |
36 | AC_MSG_RESULT(no) | |
37 | ]) | |
38 | EXTRA_KCFLAGS="$tmp_flags" | |
39 | ]) |