]> granicus.if.org Git - zfs/commitdiff
Remove user_path_dir() wrapper
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 Oct 2014 00:14:15 +0000 (20:14 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 22:11:51 +0000 (15:11 -0700)
The user_path_dir() function has been available since Linux 2.6.27.
There is no longer a need to maintain this compatibility code.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
config/spl-build.m4
module/spl/spl-vnode.c

index 712ad84700a75a5b22d7f43470b5f938c63236fc..264989d5c1caf9cbf3dd54698bd4fef6824e3c29 100644 (file)
@@ -28,7 +28,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_PDE_DATA
        SPL_AC_MUTEX_OWNER
        SPL_AC_MUTEX_OWNER_TASK_STRUCT
-       SPL_AC_USER_PATH_DIR
        SPL_AC_SET_FS_PWD
        SPL_AC_SET_FS_PWD_WITH_CONST
        SPL_AC_2ARGS_VFS_UNLINK
@@ -973,25 +972,6 @@ AC_DEFUN([SPL_AC_PDE_DATA], [
        ])
 ])
 
-dnl #
-dnl # 2.6.27 API change,
-dnl # The user_path_dir() replaces __user_walk()
-dnl #
-AC_DEFUN([SPL_AC_USER_PATH_DIR],
-       [AC_MSG_CHECKING([whether user_path_dir() is available])
-       SPL_LINUX_TRY_COMPILE_SYMBOL([
-               #include <linux/fcntl.h>
-               #include <linux/namei.h>
-       ], [
-               user_path_dir(NULL, NULL);
-       ], [user_path_at], [], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_USER_PATH_DIR, 1, [user_path_dir() is available])
-       ], [
-               AC_MSG_RESULT(no)
-       ])
-])
-
 dnl #
 dnl # Symbol available in RHEL kernels not in stock kernels.
 dnl #
index a8c5f974df2a68fadb78d8681b5cd5c377514cc7..5b0dd423562f28090db571e154d40b5b12b2b2bb 100644 (file)
@@ -798,11 +798,7 @@ set_fs_pwd(struct fs_struct *fs, struct path *path)
 int
 vn_set_pwd(const char *filename)
 {
-#ifdef HAVE_USER_PATH_DIR
         struct path path;
-#else
-        struct nameidata nd;
-#endif /* HAVE_USER_PATH_DIR */
         mm_segment_t saved_fs;
         int rc;
         SENTRY;
@@ -815,7 +811,6 @@ vn_set_pwd(const char *filename)
         saved_fs = get_fs();
         set_fs(get_ds());
 
-# ifdef HAVE_USER_PATH_DIR
         rc = user_path_dir(filename, &path);
         if (rc)
                 SGOTO(out, rc);
@@ -828,21 +823,6 @@ vn_set_pwd(const char *filename)
 
 dput_and_out:
         path_put(&path);
-# else
-        rc = __user_walk(filename,
-                         LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd);
-        if (rc)
-                SGOTO(out, rc);
-
-        rc = vfs_permission(&nd, MAY_EXEC);
-        if (rc)
-                SGOTO(dput_and_out, rc);
-
-        set_fs_pwd(current->fs, &nd.path);
-
-dput_and_out:
-        path_put(&nd.path);
-# endif /* HAVE_USER_PATH_DIR */
 out:
        set_fs(saved_fs);