1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Persistent cookie-path mappings
7 * Copyright 2002 John Levon <levon@movementarian.org>
14 #ifdef CONFIG_PROFILING
16 #include <linux/dcache.h>
17 #include <linux/types.h>
23 * dcookie_register - register a user of dcookies
25 * Register as a dcookie user. Returns %NULL on failure.
27 struct dcookie_user
* dcookie_register(void);
30 * dcookie_unregister - unregister a user of dcookies
32 * Unregister as a dcookie user. This may invalidate
33 * any dcookie values returned from get_dcookie().
35 void dcookie_unregister(struct dcookie_user
* user
);
38 * get_dcookie - acquire a dcookie
40 * Convert the given dentry/vfsmount pair into
43 * Returns -EINVAL if no living task has registered as a
46 * Returns 0 on success, with *cookie filled in
48 int get_dcookie(const struct path
*path
, unsigned long *cookie
);
52 static inline struct dcookie_user
* dcookie_register(void)
57 static inline void dcookie_unregister(struct dcookie_user
* user
)
62 static inline int get_dcookie(const struct path
*path
, unsigned long *cookie
)
67 #endif /* CONFIG_PROFILING */
69 #endif /* DCOOKIES_H */