blob: 475225a03d0dc30461124e91b0b9011322ace660 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Jan Blunckc5e725f2008-02-14 19:34:31 -08002#ifndef _LINUX_PATH_H
3#define _LINUX_PATH_H
4
5struct dentry;
6struct vfsmount;
7
8struct path {
9 struct vfsmount *mnt;
10 struct dentry *dentry;
Kees Cook3859a272016-10-28 01:22:25 -070011} __randomize_layout;
Jan Blunckc5e725f2008-02-14 19:34:31 -080012
Al Virodcf787f2013-03-01 23:51:07 -050013extern void path_get(const struct path *);
14extern void path_put(const struct path *);
Jan Blunck1d957f92008-02-14 19:34:35 -080015
Miklos Szeredi8df9d1a2010-08-10 11:41:41 +020016static inline int path_equal(const struct path *path1, const struct path *path2)
17{
18 return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
19}
20
Miklos Szeredif121aad2017-11-09 10:23:28 +010021static inline void path_put_init(struct path *path)
22{
23 path_put(path);
24 *path = (struct path) { };
25}
26
Jan Blunckc5e725f2008-02-14 19:34:31 -080027#endif /* _LINUX_PATH_H */