Linux 2.6.39 compat, kern_path_parent()

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.
This commit is contained in:
Brian Behlendorf 2011-04-20 12:25:59 -07:00
parent 83c623aa1a
commit b1cbc4610c
5 changed files with 111 additions and 3 deletions

View 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])],
[])
])

82
configure vendored
View File

@ -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

View 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 */

View 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);

View File

@ -111,6 +111,9 @@
/* 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