]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Linux 2.6.39 compat, kern_path_parent()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 Apr 2011 19:25:59 +0000 (12:25 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 Apr 2011 19:30:17 +0000 (12:30 -0700)
The path_lookup() function has been renamed to kern_path_parent()
and the flags argument has been removed.  The only behavior now
offered is that of LOOKUP_PARENT.  The spl already always passed
this flag so dropping the flag does not impact us.

config/spl-build.m4
configure
include/linux/file_compat.h
module/spl/spl-vnode.c
spl_config.h.in

index 1a7512c96b10179f50d7411ca6bf77eaa3b2c6f7..13c68358b18a2282977d38648c7c6a08a6e0a6f7 100644 (file)
@@ -79,6 +79,7 @@ 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
 ])
 
 AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -1785,3 +1786,19 @@ AC_DEFUN([SPL_AC_SHRINK_ICACHE_MEMORY], [
                [shrink_icache_memory() is available])],
                [])
 ])
+
+dnl #
+dnl # 2.6.39 API compat,
+dnl # The path_lookup() function has been renamed to kern_path_parent()
+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], [
+       SPL_CHECK_SYMBOL_EXPORT(
+               [kern_path_parent],
+               [fs/namei.c],
+               [AC_DEFINE(HAVE_KERN_PATH_PARENT, 1,
+               [kern_path_parent() is available])],
+               [])
+])
index 6a322ce4edecb97162a30650a6624ad0c0eb4cc7..476100181e917905861e0f913257220194934ac6 100755 (executable)
--- a/configure
+++ b/configure
@@ -15613,6 +15613,47 @@ _ACEOF
        fi
 
 
+
+       { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5
+$as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; }
+       grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/namei.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(kern_path_parent)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+               else
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERN_PATH_PARENT 1
+_ACEOF
+
+               fi
+       else
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERN_PATH_PARENT 1
+_ACEOF
+
+       fi
+
+
  ;;
                 user)
 
@@ -19587,6 +19628,47 @@ _ACEOF
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5
+$as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; }
+       grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/namei.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(kern_path_parent)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+               else
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERN_PATH_PARENT 1
+_ACEOF
+
+               fi
+       else
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERN_PATH_PARENT 1
+_ACEOF
+
+       fi
+
+
+
 
 
        if test "x$AWK" != xgawk; then
index 0bef014abe7070efb5e9a5a7a48f10eade374625..97bd7639610b05ac299fa3bb9d8ecbdf518f34c5 100644 (file)
@@ -67,5 +67,11 @@ spl_filp_open(const char *name, int flags, int mode, int *err)
 #define spl_inode_unlock(ip)           (up(&(ip)->i_sem))
 #endif /* HAVE_INODE_I_MUTEX */
 
+#ifdef HAVE_KERN_PATH_PARENT
+#define spl_kern_path_parent(path, nd) kern_path_parent(path, nd)
+#else
+#define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
+#endif /* HAVE_KERN_PATH_PARENT */
+
 #endif /* SPL_FILE_COMPAT_H */
 
index 1af9b29980d14e49aca2820aeedb17f2791a745a..c46643175a88644d01ac00bab3ab9d4750dd4120 100644 (file)
@@ -316,7 +316,7 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
         ASSERT(seg == UIO_SYSSPACE);
         ASSERT(flags == RMFILE);
 
-        rc = path_lookup(path, LOOKUP_PARENT, &nd);
+       rc = spl_kern_path_parent(path, &nd);
         if (rc)
                 SGOTO(exit, rc);
 
@@ -370,11 +370,11 @@ vn_rename(const char *oldname, const char *newname, int x1)
         int rc = 0;
        SENTRY;
 
-        rc = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
+        rc = spl_kern_path_parent(oldname, &oldnd);
         if (rc)
                 SGOTO(exit, rc);
 
-        rc = path_lookup(newname, LOOKUP_PARENT, &newnd);
+        rc = spl_kern_path_parent(newname, &newnd);
         if (rc)
                 SGOTO(exit1, rc);
 
index afa1535facda66fe89f38c6b70aab8c74261795f..7f084f54444b7b17f0f5f39985e95afe5b2be924 100644 (file)
 /* kallsyms_lookup_name() is available */
 #undef HAVE_KALLSYMS_LOOKUP_NAME
 
+/* kern_path_parent() is available */
+#undef HAVE_KERN_PATH_PARENT
+
 /* kmalloc_node() is available */
 #undef HAVE_KMALLOC_NODE