From 1d957f9bf87da74f420424d16ece005202bbebd3 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Thu, 14 Feb 2008 19:34:35 -0800 Subject: 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 Signed-off-by: Andreas Gruenbacher Acked-by: Christoph Hellwig Cc: Cc: Al Viro Cc: Steven French Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/open.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'fs/open.c') diff --git a/fs/open.c b/fs/open.c index 279aacf25600..ca8ac4bbd3bd 100644 --- a/fs/open.c +++ b/fs/open.c @@ -130,7 +130,7 @@ asmlinkage long sys_statfs(const char __user * path, struct statfs __user * buf) error = vfs_statfs_native(nd.path.dentry, &tmp); if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) error = -EFAULT; - path_release(&nd); + path_put(&nd.path); } return error; } @@ -149,7 +149,7 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz, struct statfs64 error = vfs_statfs64(nd.path.dentry, &tmp); if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) error = -EFAULT; - path_release(&nd); + path_put(&nd.path); } return error; } @@ -277,7 +277,7 @@ static long do_sys_truncate(const char __user * path, loff_t length) put_write_and_out: put_write_access(inode); dput_and_out: - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -462,7 +462,7 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) res = -EROFS; out_path_release: - path_release(&nd); + path_put(&nd.path); out: current->fsuid = old_fsuid; current->fsgid = old_fsgid; @@ -493,7 +493,7 @@ asmlinkage long sys_chdir(const char __user * filename) set_fs_pwd(current->fs, nd.path.mnt, nd.path.dentry); dput_and_out: - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -549,7 +549,7 @@ asmlinkage long sys_chroot(const char __user * filename) set_fs_altroot(); error = 0; dput_and_out: - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -621,7 +621,7 @@ asmlinkage long sys_fchmodat(int dfd, const char __user *filename, mutex_unlock(&inode->i_mutex); dput_and_out: - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -676,7 +676,7 @@ asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) if (error) goto out; error = chown_common(nd.path.dentry, user, group); - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -696,7 +696,7 @@ asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, if (error) goto out; error = chown_common(nd.path.dentry, user, group); - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -710,7 +710,7 @@ asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group if (error) goto out; error = chown_common(nd.path.dentry, user, group); - path_release(&nd); + path_put(&nd.path); out: return error; } @@ -894,7 +894,7 @@ struct file *nameidata_to_filp(struct nameidata *nd, int flags) filp = __dentry_open(nd->path.dentry, nd->path.mnt, flags, filp, NULL); else - path_release(nd); + path_put(&nd->path); return filp; } -- cgit v1.2.3-55-g7522