aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 9f2c13417969..995d08069d26 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2014,10 +2014,7 @@ char *d_path(const struct path *path, char *buf, int buflen)
2014 if (path->dentry->d_op && path->dentry->d_op->d_dname) 2014 if (path->dentry->d_op && path->dentry->d_op->d_dname)
2015 return path->dentry->d_op->d_dname(path->dentry, buf, buflen); 2015 return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
2016 2016
2017 read_lock(&current->fs->lock); 2017 get_fs_root(current->fs, &root);
2018 root = current->fs->root;
2019 path_get(&root);
2020 read_unlock(&current->fs->lock);
2021 spin_lock(&dcache_lock); 2018 spin_lock(&dcache_lock);
2022 tmp = root; 2019 tmp = root;
2023 res = __d_path(path, &tmp, buf, buflen); 2020 res = __d_path(path, &tmp, buf, buflen);
@@ -2129,12 +2126,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
2129 if (!page) 2126 if (!page)
2130 return -ENOMEM; 2127 return -ENOMEM;
2131 2128
2132 read_lock(&current->fs->lock); 2129 get_fs_root_and_pwd(current->fs, &root, &pwd);
2133 pwd = current->fs->pwd;
2134 path_get(&pwd);
2135 root = current->fs->root;
2136 path_get(&root);
2137 read_unlock(&current->fs->lock);
2138 2130
2139 error = -ENOENT; 2131 error = -ENOENT;
2140 spin_lock(&dcache_lock); 2132 spin_lock(&dcache_lock);