diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2010-08-10 05:41:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-11 00:28:20 -0400 |
commit | f7ad3c6be90809b53b7f0ae9d4eaa45ce2564a79 (patch) | |
tree | dc9b09188bab35320200f318b5e7b52f24dc43ad /fs/namespace.c | |
parent | 542ce7a9bc6b3838832ae0f4f8de30c667af8ff3 (diff) |
vfs: add helpers to get root and pwd
Add three helpers that retrieve a refcounted copy of the root and cwd
from the supplied fs_struct.
get_fs_root()
get_fs_pwd()
get_fs_root_and_pwd()
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 66c4f7e781cb..7972e51ccc06 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2213,10 +2213,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, | |||
2213 | goto out1; | 2213 | goto out1; |
2214 | } | 2214 | } |
2215 | 2215 | ||
2216 | read_lock(¤t->fs->lock); | 2216 | get_fs_root(current->fs, &root); |
2217 | root = current->fs->root; | ||
2218 | path_get(¤t->fs->root); | ||
2219 | read_unlock(¤t->fs->lock); | ||
2220 | down_write(&namespace_sem); | 2217 | down_write(&namespace_sem); |
2221 | mutex_lock(&old.dentry->d_inode->i_mutex); | 2218 | mutex_lock(&old.dentry->d_inode->i_mutex); |
2222 | error = -EINVAL; | 2219 | error = -EINVAL; |