Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d957f9b authored by Jan Blunck's avatar Jan Blunck Committed by Linus Torvalds
Browse files

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: default avatarJan Blunck <jblunck@suse.de>
Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
Acked-by: default avatarChristoph 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4ac91378
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ osf_statfs(char __user *path, struct osf_statfs __user *buffer, unsigned long bu
	retval = user_path_walk(path, &nd);
	if (!retval) {
		retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz);
		path_release(&nd);
		path_put(&nd.path);
	}
	return retval;
}
+3 −3
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ asmlinkage int irix_statfs(const char __user *path,
	}

dput_and_out:
	path_release(&nd);
	path_put(&nd.path);
out:
	return error;
}
@@ -1385,7 +1385,7 @@ asmlinkage int irix_statvfs(char __user *fname, struct irix_statvfs __user *buf)
		error |= __put_user(0, &buf->f_fstr[i]);

dput_and_out:
	path_release(&nd);
	path_put(&nd.path);
out:
	return error;
}
@@ -1636,7 +1636,7 @@ asmlinkage int irix_statvfs64(char __user *fname, struct irix_statvfs64 __user *
		error |= __put_user(0, &buf->f_fstr[i]);

dput_and_out:
	path_release(&nd);
	path_put(&nd.path);
out:
	return error;
}
+1 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ asmlinkage long hpux_statfs(const char __user *path,
		error = vfs_statfs_hpux(nd.path.dentry, &tmp);
		if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
			error = -EFAULT;
		path_release(&nd);
		path_put(&nd.path);
	}
	return error;
}
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
				LOOKUP_OPEN|LOOKUP_CREATE, &nd);
		if (!ret) {
			ret = spufs_create(&nd, flags, mode, neighbor);
			path_release(&nd);
			path_put(&nd.path);
		}
		putname(tmp);
	}
+2 −2
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ asmlinkage int solaris_statvfs(u32 path, u32 buf)
	if (!error) {
		struct inode *inode = nd.path.dentry->d_inode;
		error = report_statvfs(nd.path.mnt, inode, buf);
		path_release(&nd);
		path_put(&nd.path);
	}
	return error;
}
@@ -466,7 +466,7 @@ asmlinkage int solaris_statvfs64(u32 path, u32 buf)
	if (!error) {
		struct inode *inode = nd.path.dentry->d_inode;
		error = report_statvfs64(nd.path.mnt, inode, buf);
		path_release(&nd);
		path_put(&nd.path);
	}
	unlock_kernel();
	return error;
Loading