summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 19:34:38 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-14 21:13:33 -0800
commit6ac08c39a16f72c2d3e845cb6849a1392fa03e80 (patch)
treed7603571e9ab3ea4b57b7901211320e48d0c5ed8 /kernel
parent5dd784d04924be5d8bc066aded0ec3274b20e612 (diff)
Use struct path in fs_struct
* Use struct path in fs_struct. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Jan Blunck <jblunck@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditsc.c4
-rw-r--r--kernel/exit.c12
-rw-r--r--kernel/fork.c18
3 files changed, 15 insertions, 19 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 1c06ecf38d7..741291a1de0 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1697,8 +1697,8 @@ void __audit_getname(const char *name)
++context->name_count;
if (!context->pwd) {
read_lock(&current->fs->lock);
- context->pwd = dget(current->fs->pwd);
- context->pwdmnt = mntget(current->fs->pwdmnt);
+ context->pwd = dget(current->fs->pwd.dentry);
+ context->pwdmnt = mntget(current->fs->pwd.mnt);
read_unlock(&current->fs->lock);
}
diff --git a/kernel/exit.c b/kernel/exit.c
index 3b893e78ce6..506a957b665 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -512,14 +512,10 @@ static void __put_fs_struct(struct fs_struct *fs)
{
/* No need to hold fs->lock if we are killing it */
if (atomic_dec_and_test(&fs->count)) {
- dput(fs->root);
- mntput(fs->rootmnt);
- dput(fs->pwd);
- mntput(fs->pwdmnt);
- if (fs->altroot) {
- dput(fs->altroot);
- mntput(fs->altrootmnt);
- }
+ path_put(&fs->root);
+ path_put(&fs->pwd);
+ if (fs->altroot.dentry)
+ path_put(&fs->altroot);
kmem_cache_free(fs_cachep, fs);
}
}
diff --git a/kernel/fork.c b/kernel/fork.c
index 4363a4eb84e..dd249c37b3a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -600,16 +600,16 @@ static struct fs_struct *__copy_fs_struct(struct fs_struct *old)
rwlock_init(&fs->lock);
fs->umask = old->umask;
read_lock(&old->lock);
- fs->rootmnt = mntget(old->rootmnt);
- fs->root = dget(old->root);
- fs->pwdmnt = mntget(old->pwdmnt);
- fs->pwd = dget(old->pwd);
- if (old->altroot) {
- fs->altrootmnt = mntget(old->altrootmnt);
- fs->altroot = dget(old->altroot);
+ fs->root = old->root;
+ path_get(&old->root);
+ fs->pwd = old->pwd;
+ path_get(&old->pwd);
+ if (old->altroot.dentry) {
+ fs->altroot = old->altroot;
+ path_get(&old->altroot);
} else {
- fs->altrootmnt = NULL;
- fs->altroot = NULL;
+ fs->altroot.mnt = NULL;
+ fs->altroot.dentry = NULL;
}
read_unlock(&old->lock);
}