aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 13ff4abdbdca..17ea76bf2fbe 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -483,13 +483,8 @@ ok:
483 483
484static __always_inline void set_root(struct nameidata *nd) 484static __always_inline void set_root(struct nameidata *nd)
485{ 485{
486 if (!nd->root.mnt) { 486 if (!nd->root.mnt)
487 struct fs_struct *fs = current->fs; 487 get_fs_root(current->fs, &nd->root);
488 read_lock(&fs->lock);
489 nd->root = fs->root;
490 path_get(&nd->root);
491 read_unlock(&fs->lock);
492 }
493} 488}
494 489
495static int link_path_walk(const char *, struct nameidata *); 490static int link_path_walk(const char *, struct nameidata *);
@@ -1015,11 +1010,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, struct namei
1015 nd->path = nd->root; 1010 nd->path = nd->root;
1016 path_get(&nd->root); 1011 path_get(&nd->root);
1017 } else if (dfd == AT_FDCWD) { 1012 } else if (dfd == AT_FDCWD) {
1018 struct fs_struct *fs = current->fs; 1013 get_fs_pwd(current->fs, &nd->path);
1019 read_lock(&fs->lock);
1020 nd->path = fs->pwd;
1021 path_get(&fs->pwd);
1022 read_unlock(&fs->lock);
1023 } else { 1014 } else {
1024 struct dentry *dentry; 1015 struct dentry *dentry;
1025 1016