apparmor: use task path helpers
authorNick Piggin <npiggin@kernel.dk>
Tue, 17 Aug 2010 18:37:32 +0000 (04:37 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Aug 2010 12:35:46 +0000 (08:35 -0400)
apparmor: use task path helpers

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
security/apparmor/path.c

index 96bab9469d487fb8bc66c4724f14c51bf86b295a..19358dc14605bae1422ae00226291751695ba44c 100644 (file)
@@ -62,19 +62,14 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
        int deleted, connected;
        int error = 0;
 
-       /* Get the root we want to resolve too */
+       /* Get the root we want to resolve too, released below */
        if (flags & PATH_CHROOT_REL) {
                /* resolve paths relative to chroot */
-               read_lock(&current->fs->lock);
-               root = current->fs->root;
-               /* released below */
-               path_get(&root);
-               read_unlock(&current->fs->lock);
+               get_fs_root(current->fs, &root);
        } else {
                /* resolve paths relative to namespace */
                root.mnt = current->nsproxy->mnt_ns->root;
                root.dentry = root.mnt->mnt_root;
-               /* released below */
                path_get(&root);
        }