]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-bdev-physical-size.m4
Fix typesetting of Errata #4
[mirror_zfs.git] / config / kernel-bdev-physical-size.m4
CommitLineData
2404b014
BB
1dnl #
2dnl # 2.6.30 API change
3dnl #
4dnl # The bdev_physical_block_size() interface was added to provide a way
5dnl # to determine the smallest write which can be performed without a
6dnl # read-modify-write operation. From the kernel documentation:
7dnl #
8dnl # What: /sys/block/<disk>/queue/physical_block_size
9dnl # Date: May 2009
10dnl # Contact: Martin K. Petersen <martin.petersen@oracle.com>
11dnl # Description:
12dnl # This is the smallest unit the storage device can write
13dnl # without resorting to read-modify-write operation. It is
14dnl # usually the same as the logical block size but may be
15dnl # bigger. One example is SATA drives with 4KB sectors
16dnl # that expose a 512-byte logical block size to the
17dnl # operating system.
18dnl #
19dnl # Unfortunately, this interface isn't entirely reliable because
20dnl # drives are sometimes known to misreport this value.
21dnl #
22AC_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])