diff options
author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:34:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:13:33 -0500 |
commit | 1d957f9bf87da74f420424d16ece005202bbebd3 (patch) | |
tree | 363d4770c0c74a536524c99ccd2762ce96ee9bbe /kernel | |
parent | 4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (diff) |
Introduce path_put()
* Add path_put() functions for releasing a reference to the dentry and
vfsmount of a struct path in the right order
* Switch from path_release(nd) to path_put(&nd->path)
* Rename dput_path() to path_put_conditional()
[akpm@linux-foundation.org: fix cifs]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Steven French <sfrench@us.ibm.com>
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/audit_tree.c | 12 | ||||
-rw-r--r-- | kernel/auditfilter.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index b898814fe4a0..9ef5e0aacc3c 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c | |||
@@ -550,7 +550,7 @@ void audit_trim_trees(void) | |||
550 | goto skip_it; | 550 | goto skip_it; |
551 | 551 | ||
552 | root_mnt = collect_mounts(nd.path.mnt, nd.path.dentry); | 552 | root_mnt = collect_mounts(nd.path.mnt, nd.path.dentry); |
553 | path_release(&nd); | 553 | path_put(&nd.path); |
554 | if (!root_mnt) | 554 | if (!root_mnt) |
555 | goto skip_it; | 555 | goto skip_it; |
556 | 556 | ||
@@ -642,7 +642,7 @@ int audit_add_tree_rule(struct audit_krule *rule) | |||
642 | if (err) | 642 | if (err) |
643 | goto Err; | 643 | goto Err; |
644 | mnt = collect_mounts(nd.path.mnt, nd.path.dentry); | 644 | mnt = collect_mounts(nd.path.mnt, nd.path.dentry); |
645 | path_release(&nd); | 645 | path_put(&nd.path); |
646 | if (!mnt) { | 646 | if (!mnt) { |
647 | err = -ENOMEM; | 647 | err = -ENOMEM; |
648 | goto Err; | 648 | goto Err; |
@@ -702,7 +702,7 @@ int audit_tag_tree(char *old, char *new) | |||
702 | if (err) | 702 | if (err) |
703 | return err; | 703 | return err; |
704 | tagged = collect_mounts(nd.path.mnt, nd.path.dentry); | 704 | tagged = collect_mounts(nd.path.mnt, nd.path.dentry); |
705 | path_release(&nd); | 705 | path_put(&nd.path); |
706 | if (!tagged) | 706 | if (!tagged) |
707 | return -ENOMEM; | 707 | return -ENOMEM; |
708 | 708 | ||
@@ -713,7 +713,7 @@ int audit_tag_tree(char *old, char *new) | |||
713 | } | 713 | } |
714 | mnt = mntget(nd.path.mnt); | 714 | mnt = mntget(nd.path.mnt); |
715 | dentry = dget(nd.path.dentry); | 715 | dentry = dget(nd.path.dentry); |
716 | path_release(&nd); | 716 | path_put(&nd.path); |
717 | 717 | ||
718 | if (dentry == tagged->mnt_root && dentry == mnt->mnt_root) | 718 | if (dentry == tagged->mnt_root && dentry == mnt->mnt_root) |
719 | follow_up(&mnt, &dentry); | 719 | follow_up(&mnt, &dentry); |
@@ -744,13 +744,13 @@ int audit_tag_tree(char *old, char *new) | |||
744 | spin_lock(&vfsmount_lock); | 744 | spin_lock(&vfsmount_lock); |
745 | if (!is_under(mnt, dentry, &nd)) { | 745 | if (!is_under(mnt, dentry, &nd)) { |
746 | spin_unlock(&vfsmount_lock); | 746 | spin_unlock(&vfsmount_lock); |
747 | path_release(&nd); | 747 | path_put(&nd.path); |
748 | put_tree(tree); | 748 | put_tree(tree); |
749 | mutex_lock(&audit_filter_mutex); | 749 | mutex_lock(&audit_filter_mutex); |
750 | continue; | 750 | continue; |
751 | } | 751 | } |
752 | spin_unlock(&vfsmount_lock); | 752 | spin_unlock(&vfsmount_lock); |
753 | path_release(&nd); | 753 | path_put(&nd.path); |
754 | 754 | ||
755 | list_for_each_entry(p, &list, mnt_list) { | 755 | list_for_each_entry(p, &list, mnt_list) { |
756 | failed = tag_chunk(p->mnt_root->d_inode, tree); | 756 | failed = tag_chunk(p->mnt_root->d_inode, tree); |
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index a36e66797c3d..2f2914b7cc30 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -1161,11 +1161,11 @@ static int audit_get_nd(char *path, struct nameidata **ndp, | |||
1161 | static void audit_put_nd(struct nameidata *ndp, struct nameidata *ndw) | 1161 | static void audit_put_nd(struct nameidata *ndp, struct nameidata *ndw) |
1162 | { | 1162 | { |
1163 | if (ndp) { | 1163 | if (ndp) { |
1164 | path_release(ndp); | 1164 | path_put(&ndp->path); |
1165 | kfree(ndp); | 1165 | kfree(ndp); |
1166 | } | 1166 | } |
1167 | if (ndw) { | 1167 | if (ndw) { |
1168 | path_release(ndw); | 1168 | path_put(&ndw->path); |
1169 | kfree(ndw); | 1169 | kfree(ndw); |
1170 | } | 1170 | } |
1171 | } | 1171 | } |