Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / include / linux / dcookies.h
blob24c806f12a6c96966b0764a9224821fcc5bee434
1 /*
2 * dcookies.h
4 * Persistent cookie-path mappings
6 * Copyright 2002 John Levon <levon@movementarian.org>
7 */
9 #ifndef DCOOKIES_H
10 #define DCOOKIES_H
13 #ifdef CONFIG_PROFILING
15 #include <linux/dcache.h>
16 #include <linux/path.h>
17 #include <linux/types.h>
19 struct dcookie_user;
21 /**
22 * dcookie_register - register a user of dcookies
24 * Register as a dcookie user. Returns %NULL on failure.
26 struct dcookie_user * dcookie_register(void);
28 /**
29 * dcookie_unregister - unregister a user of dcookies
31 * Unregister as a dcookie user. This may invalidate
32 * any dcookie values returned from get_dcookie().
34 void dcookie_unregister(struct dcookie_user * user);
36 /**
37 * get_dcookie - acquire a dcookie
39 * Convert the given dentry/vfsmount pair into
40 * a cookie value.
42 * Returns -EINVAL if no living task has registered as a
43 * dcookie user.
45 * Returns 0 on success, with *cookie filled in
47 int get_dcookie(struct path *path, unsigned long *cookie);
49 #else
51 static inline struct dcookie_user * dcookie_register(void)
53 return NULL;
56 static inline void dcookie_unregister(struct dcookie_user * user)
58 return;
61 static inline int get_dcookie(struct path *path, unsigned long *cookie)
63 return -ENOSYS;
66 #endif /* CONFIG_PROFILING */
68 #endif /* DCOOKIES_H */