aboutsummaryrefslogtreecommitdiffstats
path: root/module/spl/spl-vnode.c
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2013-03-11 22:02:45 -0400
committerBrian Behlendorf <[email protected]>2013-03-14 10:43:31 -0700
commit8274ed598801255626b8c1648c3a4cdfea07b738 (patch)
tree3b26241295af554c650c17f312407024f5a0bf6a /module/spl/spl-vnode.c
parenta54718cfe0d8e8a4b124f176f0d5c94141f9aea0 (diff)
Drop support for 3 argument version of set_fs_pwd
This was a suggestion that Brian Behlendorf made when reviewing an early pull request for Linux 3.9 support. This commit was made intentionally easy to revert should we ever have a reason to reintroduce support for older kernels. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/spl/spl-vnode.c')
-rw-r--r--module/spl/spl-vnode.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
index dac452c10..4f56f1039 100644
--- a/module/spl/spl-vnode.c
+++ b/module/spl/spl-vnode.c
@@ -837,8 +837,6 @@ vn_releasef(int fd)
EXPORT_SYMBOL(releasef);
#ifndef HAVE_SET_FS_PWD
-# ifdef HAVE_2ARGS_SET_FS_PWD
-/* Used from 2.6.25 - 2.6.31+ */
void
# ifdef HAVE_SET_FS_PWD_WITH_CONST
set_fs_pwd(struct fs_struct *fs, const struct path *path)
@@ -865,37 +863,16 @@ set_fs_pwd(struct fs_struct *fs, struct path *path)
if (old_pwd.dentry)
path_put(&old_pwd);
}
-# else
-/* Used from 2.6.11 - 2.6.24 */
-void
-set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, struct dentry *dentry)
-{
- struct dentry *old_pwd;
- struct vfsmount *old_pwdmnt;
-
- write_lock(&fs->lock);
- old_pwd = fs->pwd;
- old_pwdmnt = fs->pwdmnt;
- fs->pwdmnt = mntget(mnt);
- fs->pwd = dget(dentry);
- write_unlock(&fs->lock);
-
- if (old_pwd) {
- dput(old_pwd);
- mntput(old_pwdmnt);
- }
-}
-# endif /* HAVE_2ARGS_SET_FS_PWD */
#endif /* HAVE_SET_FS_PWD */
int
vn_set_pwd(const char *filename)
{
-#if defined(HAVE_2ARGS_SET_FS_PWD) && defined(HAVE_USER_PATH_DIR)
+#ifdef HAVE_USER_PATH_DIR
struct path path;
#else
struct nameidata nd;
-#endif /* HAVE_2ARGS_SET_FS_PWD */
+#endif /* HAVE_USER_PATH_DIR */
mm_segment_t saved_fs;
int rc;
SENTRY;
@@ -908,7 +885,6 @@ vn_set_pwd(const char *filename)
saved_fs = get_fs();
set_fs(get_ds());
-#ifdef HAVE_2ARGS_SET_FS_PWD
# ifdef HAVE_USER_PATH_DIR
rc = user_path_dir(filename, &path);
if (rc)
@@ -937,21 +913,6 @@ dput_and_out:
dput_and_out:
path_put(&nd.path);
# endif /* HAVE_USER_PATH_DIR */
-#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.nd_mnt, nd.nd_dentry);
-
-dput_and_out:
- vn_path_release(&nd);
-#endif /* HAVE_2ARGS_SET_FS_PWD */
out:
set_fs(saved_fs);