Commit f121aade authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

vfs: add path_put_init()



This one initializes the struct path to all zeroes so that multiple
path_put_init() on the path is safe.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent f30536f0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,4 +18,10 @@ static inline int path_equal(const struct path *path1, const struct path *path2)
	return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
}

static inline void path_put_init(struct path *path)
{
	path_put(path);
	*path = (struct path) { };
}

#endif  /* _LINUX_PATH_H */