SPL_AC_ZONE_STAT_ITEM_INACTIVE
SPL_AC_ZONE_STAT_ITEM_ACTIVE
SPL_AC_GET_ZONE_COUNTS
+ SPL_AC_USER_PATH_DIR
SPL_AC_SET_FS_PWD
SPL_AC_2ARGS_SET_FS_PWD
SPL_AC_2ARGS_VFS_UNLINK
])
])
+dnl #
+dnl # 2.6.27 API change,
+dnl # The user_path_dir() replaces __user_walk()
+dnl #
+AC_DEFUN([SPL_AC_USER_PATH_DIR], [
+ SPL_CHECK_SYMBOL_EXPORT(
+ [user_path_at],
+ [],
+ [AC_DEFINE(HAVE_USER_PATH_DIR, 1,
+ [user_path_dir() is available])],
+ [])
+])
+
dnl #
dnl # Symbol available in RHEL kernels not in stock kernels.
dnl #
+ { $as_echo "$as_me:$LINENO: checking whether symbol user_path_at is exported" >&5
+$as_echo_n "checking whether symbol user_path_at is exported... " >&6; }
+ grep -q -E '[[:space:]]user_path_at[[:space:]]' \
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
+ rc=$?
+ if test $rc -ne 0; then
+ export=0
+ for file in ; do
+ grep -q -E "EXPORT_SYMBOL.*(user_path_at)" \
+ "$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_USER_PATH_DIR 1
+_ACEOF
+
+ fi
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_USER_PATH_DIR 1
+_ACEOF
+
+ fi
+
+
+
{ $as_echo "$as_me:$LINENO: checking whether symbol set_fs_pwd is exported" >&5
$as_echo_n "checking whether symbol set_fs_pwd is exported... " >&6; }
grep -q -E '[[:space:]]set_fs_pwd[[:space:]]' \
+ { $as_echo "$as_me:$LINENO: checking whether symbol user_path_at is exported" >&5
+$as_echo_n "checking whether symbol user_path_at is exported... " >&6; }
+ grep -q -E '[[:space:]]user_path_at[[:space:]]' \
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
+ rc=$?
+ if test $rc -ne 0; then
+ export=0
+ for file in ; do
+ grep -q -E "EXPORT_SYMBOL.*(user_path_at)" \
+ "$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_USER_PATH_DIR 1
+_ACEOF
+
+ fi
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_USER_PATH_DIR 1
+_ACEOF
+
+ fi
+
+
+
{ $as_echo "$as_me:$LINENO: checking whether symbol set_fs_pwd is exported" >&5
$as_echo_n "checking whether symbol set_fs_pwd is exported... " >&6; }
grep -q -E '[[:space:]]set_fs_pwd[[:space:]]' \
int
vn_set_pwd(const char *filename)
{
-#ifdef HAVE_2ARGS_SET_FS_PWD
+#if defined(HAVE_2ARGS_SET_FS_PWD) && defined(HAVE_USER_PATH_DIR)
struct path path;
#else
struct nameidata nd;
set_fs(get_ds());
#ifdef HAVE_2ARGS_SET_FS_PWD
+# ifdef HAVE_USER_PATH_DIR
rc = user_path_dir(filename, &path);
if (rc)
GOTO(out, rc);
dput_and_out:
path_put(&path);
+# else
+ rc = __user_walk(filename,
+ LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd);
+ if (rc)
+ GOTO(out, rc);
+
+ rc = vfs_permission(&nd, MAY_EXEC);
+ if (rc)
+ GOTO(dput_and_out, rc);
+
+ set_fs_pwd(current->fs, &nd.path);
+
+dput_and_out:
+ path_put(&nd.path);
+# endif /* HAVE_USER_PATH_DIR */
#else
rc = __user_walk(filename,
LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd);