X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=config%2Fkernel-bdev-block-device-operations.m4;h=faacc195da9b4211675c2254d33d86a34378f1d7;hb=a1d9543a39942be56879ca9338078afc77c25cea;hp=2805237aa9b376e1896a24a4c70391417e3f44ae;hpb=b9c59ec83ab50e1cd097f067461e34a5750694c8;p=zfs.git diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4 index 2805237..faacc19 100644 --- a/config/kernel-bdev-block-device-operations.m4 +++ b/config/kernel-bdev-block-device-operations.m4 @@ -4,27 +4,25 @@ dnl # AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [ AC_MSG_CHECKING([block device operation prototypes]) tmp_flags="$EXTRA_KCFLAGS" - EXTRA_KCFLAGS="-Wno-unused-but-set-variable" + EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}" ZFS_LINUX_TRY_COMPILE([ #include - ],[ - int (*blk_open) (struct block_device *, fmode_t) = NULL; - int (*blk_release) (struct gendisk *, fmode_t) = NULL; - int (*blk_ioctl) (struct block_device *, fmode_t, - unsigned, unsigned long) = NULL; - int (*blk_compat_ioctl) (struct block_device *, fmode_t, - unsigned, unsigned long) = NULL; - struct block_device_operations blk_ops = { + + int blk_open(struct block_device *bdev, fmode_t mode) + { return 0; } + int blk_ioctl(struct block_device *bdev, fmode_t mode, + unsigned x, unsigned long y) { return 0; } + int blk_compat_ioctl(struct block_device * bdev, fmode_t mode, + unsigned x, unsigned long y) { return 0; } + + static const struct block_device_operations + bops __attribute__ ((unused)) = { .open = blk_open, - .release = blk_release, + .release = NULL, .ioctl = blk_ioctl, .compat_ioctl = blk_compat_ioctl, }; - - blk_ops.open(NULL, 0); - blk_ops.release(NULL, 0); - blk_ops.ioctl(NULL, 0, 0, 0); - blk_ops.compat_ioctl(NULL, 0, 0, 0); + ],[ ],[ AC_MSG_RESULT(struct block_device) AC_DEFINE(HAVE_BDEV_BLOCK_DEVICE_OPERATIONS, 1,