diff options
author | Brian Behlendorf <[email protected]> | 2013-01-28 14:15:39 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-01-28 15:35:00 -0800 |
commit | 2b7ab9d4d9b307c354795e2805ff313ddd01985d (patch) | |
tree | d58656a05ce0968b6d931bc36b0ef7bdaeb5c0ca /config/kernel-lookup-bdev.m4 | |
parent | 930b6fec210d828cb3755f8756dbbbf3001cccae (diff) |
Linux 2.6.26 compat, lookup_bdev()
It's doubtful many people were impacted by this but commit 6c28567
accidentally broke ZFS builds for 2.6.26 and earlier kernels. This
commit depends on the lookup_bdev() function which exists in 2.6.26
but wasn't exported until 2.6.27.
The availability of the function isn't critical so a wrapper is
introduced which returns ERR_PTR(-ENOTSUP) when the function isn't
defined. This will have the effect of causing zvol_is_zvol() to
always fail for 2.6.26 kernels. This in turn means vdevs will
always get opened concurrently which is good for normal usage.
This will only become an issue if your using a zvol as a vdev in
another pool. In which case you really should be using a newer
kernel anyway.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1205
Diffstat (limited to 'config/kernel-lookup-bdev.m4')
-rw-r--r-- | config/kernel-lookup-bdev.m4 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/config/kernel-lookup-bdev.m4 b/config/kernel-lookup-bdev.m4 new file mode 100644 index 000000000..245f95f04 --- /dev/null +++ b/config/kernel-lookup-bdev.m4 @@ -0,0 +1,17 @@ +dnl # +dnl # 2.6.27 API change +dnl # lookup_bdev() was exported. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_BDEV], + [AC_MSG_CHECKING([whether lookup_bdev() is available]) + ZFS_LINUX_TRY_COMPILE_SYMBOL([ + #include <linux/fs.h> + ], [ + lookup_bdev(NULL); + ], [lookup_bdev], [fs/block_dev.c], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LOOKUP_BDEV, 1, [lookup_bdev() is available]) + ], [ + AC_MSG_RESULT(no) + ]) +]) |