aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 22:34:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 00:13:33 -0500
commit1d957f9bf87da74f420424d16ece005202bbebd3 (patch)
tree363d4770c0c74a536524c99ccd2762ce96ee9bbe /fs/namespace.c
parent4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (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 'fs/namespace.c')
-rw-r--r--fs/namespace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 5d9fd4c6d1f5..c77eedd2ac66 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1007,7 +1007,7 @@ static noinline int do_loopback(struct nameidata *nd, char *old_name,
1007 1007
1008out: 1008out:
1009 up_write(&namespace_sem); 1009 up_write(&namespace_sem);
1010 path_release(&old_nd); 1010 path_put(&old_nd.path);
1011 return err; 1011 return err;
1012} 1012}
1013 1013
@@ -1126,8 +1126,8 @@ out1:
1126out: 1126out:
1127 up_write(&namespace_sem); 1127 up_write(&namespace_sem);
1128 if (!err) 1128 if (!err)
1129 path_release(&parent_nd); 1129 path_put(&parent_nd.path);
1130 path_release(&old_nd); 1130 path_put(&old_nd.path);
1131 return err; 1131 return err;
1132} 1132}
1133 1133
@@ -1512,7 +1512,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1512 retval = do_new_mount(&nd, type_page, flags, mnt_flags, 1512 retval = do_new_mount(&nd, type_page, flags, mnt_flags,
1513 dev_name, data_page); 1513 dev_name, data_page);
1514dput_out: 1514dput_out:
1515 path_release(&nd); 1515 path_put(&nd.path);
1516 return retval; 1516 return retval;
1517} 1517}
1518 1518
@@ -1768,7 +1768,7 @@ asmlinkage long sys_pivot_root(const char __user * new_root,
1768 1768
1769 error = security_sb_pivotroot(&old_nd, &new_nd); 1769 error = security_sb_pivotroot(&old_nd, &new_nd);
1770 if (error) { 1770 if (error) {
1771 path_release(&old_nd); 1771 path_put(&old_nd.path);
1772 goto out1; 1772 goto out1;
1773 } 1773 }
1774 1774
@@ -1831,15 +1831,15 @@ asmlinkage long sys_pivot_root(const char __user * new_root,
1831 chroot_fs_refs(&user_nd, &new_nd); 1831 chroot_fs_refs(&user_nd, &new_nd);
1832 security_sb_post_pivotroot(&user_nd, &new_nd); 1832 security_sb_post_pivotroot(&user_nd, &new_nd);
1833 error = 0; 1833 error = 0;
1834 path_release(&root_parent); 1834 path_put(&root_parent.path);
1835 path_release(&parent_nd); 1835 path_put(&parent_nd.path);
1836out2: 1836out2:
1837 mutex_unlock(&old_nd.path.dentry->d_inode->i_mutex); 1837 mutex_unlock(&old_nd.path.dentry->d_inode->i_mutex);
1838 up_write(&namespace_sem); 1838 up_write(&namespace_sem);
1839 path_release(&user_nd); 1839 path_put(&user_nd.path);
1840 path_release(&old_nd); 1840 path_put(&old_nd.path);
1841out1: 1841out1:
1842 path_release(&new_nd); 1842 path_put(&new_nd.path);
1843out0: 1843out0:
1844 unlock_kernel(); 1844 unlock_kernel();
1845 return error; 1845 return error;