aboutsummaryrefslogtreecommitdiff
path: root/fs/cachefiles
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2010-08-10 11:41:36 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-11 00:28:20 -0400
commitf7ad3c6be90809b53b7f0ae9d4eaa45ce2564a79 (patch)
treedc9b09188bab35320200f318b5e7b52f24dc43ad /fs/cachefiles
parent542ce7a9bc6b3838832ae0f4f8de30c667af8ff3 (diff)
downloadlinux-f7ad3c6be90809b53b7f0ae9d4eaa45ce2564a79.tar.gz
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/cachefiles')
-rw-r--r--fs/cachefiles/daemon.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
index 72d4d004282..727caedcdd9 100644
--- a/fs/cachefiles/daemon.c
+++ b/fs/cachefiles/daemon.c
@@ -552,7 +552,6 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args)
*/
static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
{
- struct fs_struct *fs;
struct path path;
const struct cred *saved_cred;
int ret;
@@ -573,11 +572,7 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
}
/* extract the directory dentry from the cwd */
- fs = current->fs;
- read_lock(&fs->lock);
- path = fs->pwd;
- path_get(&path);
- read_unlock(&fs->lock);
+ get_fs_pwd(current->fs, &path);
if (!S_ISDIR(path.dentry->d_inode->i_mode))
goto notdir;
@@ -629,7 +624,6 @@ inval:
*/
static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
{
- struct fs_struct *fs;
struct path path;
const struct cred *saved_cred;
int ret;
@@ -650,11 +644,7 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
}
/* extract the directory dentry from the cwd */
- fs = current->fs;
- read_lock(&fs->lock);
- path = fs->pwd;
- path_get(&path);
- read_unlock(&fs->lock);
+ get_fs_pwd(current->fs, &path);
if (!S_ISDIR(path.dentry->d_inode->i_mode))
goto notdir;