2 dnl # 2.6.30 API change
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:
8 dnl # What: /sys/block/<disk>/queue/physical_block_size
10 dnl # Contact: Martin K. Petersen <martin.petersen@oracle.com>
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.
19 dnl # Unfortunately, this interface isn't entirely reliable because
20 dnl # drives are sometimes known to misreport this value.
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"
25 EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
26 ZFS_LINUX_TRY_COMPILE([
27 #include <linux/blkdev.h>
29 struct block_device *bdev = NULL;
30 bdev_physical_block_size(bdev);
33 AC_DEFINE(HAVE_BDEV_PHYSICAL_BLOCK_SIZE, 1,
34 [bdev_physical_block_size() is available])
38 EXTRA_KCFLAGS="$tmp_flags"