diff options
author | Brian Behlendorf <[email protected]> | 2011-11-09 12:29:51 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-11-09 16:51:25 -0800 |
commit | 12ff95ff579d0203790aff69632c7ab12ce56140 (patch) | |
tree | fac52bd30a7fc2f1589c5192788bc0b656abd24a /config | |
parent | b8b6e4c453929596b630fa1cca1ee26a532a2ab4 (diff) |
Linux 3.1 compat, kern_path_parent()
Prior to Linux 3.1 the kern_path_parent symbol was exported for
use by kernel modules. As of Linux 3.1 it is now longer easily
available. To handle this case the spl will now dynamically
look up address of the missing symbol at module load time.
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #52
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index c046db830..f5696b943 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -80,7 +80,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES SPL_AC_SHRINK_DCACHE_MEMORY SPL_AC_SHRINK_ICACHE_MEMORY - SPL_AC_KERN_PATH_PARENT + SPL_AC_KERN_PATH_PARENT_HEADER + SPL_AC_KERN_PATH_PARENT_SYMBOL SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE SPL_AC_SHRINK_CONTROL_STRUCT ]) @@ -588,6 +589,30 @@ AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], ]) dnl # +dnl # SPL_CHECK_SYMBOL_HEADER +dnl # check if a symbol prototype is defined in listed headers. +dnl # +AC_DEFUN([SPL_CHECK_SYMBOL_HEADER], [ + AC_MSG_CHECKING([whether symbol $1 exists in header]) + header=0 + for file in $3; do + grep -q "$2" "$LINUX/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + header=1 + break; + fi + done + if test $header -eq 0; then + AC_MSG_RESULT([no]) + $5 + else + AC_MSG_RESULT([yes]) + $4 + fi +]) + +dnl # dnl # SPL_CHECK_HEADER dnl # check whether header exists and define HAVE_$2_HEADER dnl # @@ -1809,11 +1834,27 @@ dnl # and the flags argument has been removed. The only behavior now dnl # offered is that of LOOKUP_PARENT. The spl already always passed dnl # this flag so dropping the flag does not impact us. dnl # -AC_DEFUN([SPL_AC_KERN_PATH_PARENT], [ +AC_DEFUN([SPL_AC_KERN_PATH_PARENT_HEADER], [ + SPL_CHECK_SYMBOL_HEADER( + [kern_path_parent], + [int kern_path_parent(const char \*, struct nameidata \*)], + [include/linux/namei.h], + [AC_DEFINE(HAVE_KERN_PATH_PARENT_HEADER, 1, + [kern_path_parent() is available])], + []) +]) + +dnl # +dnl # 3.1 API compat, +dnl # The kern_path_parent() symbol is no longer exported by the kernel. +dnl # However, it remains the prefered interface and since we still have +dnl # access to the prototype we dynamically lookup the required address. +dnl # +AC_DEFUN([SPL_AC_KERN_PATH_PARENT_SYMBOL], [ SPL_CHECK_SYMBOL_EXPORT( [kern_path_parent], [fs/namei.c], - [AC_DEFINE(HAVE_KERN_PATH_PARENT, 1, + [AC_DEFINE(HAVE_KERN_PATH_PARENT_SYMBOL, 1, [kern_path_parent() is available])], []) ]) |