libata-link: separate out link initialization functions
[pv_ops_mirror.git] / include / linux / dcookies.h
blob98c69ab80c849a65ce70eecac68dda81bd6eef82
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/types.h>
18 struct dcookie_user;
20 /**
21 * dcookie_register - register a user of dcookies
23 * Register as a dcookie user. Returns %NULL on failure.
25 struct dcookie_user * dcookie_register(void);
27 /**
28 * dcookie_unregister - unregister a user of dcookies
30 * Unregister as a dcookie user. This may invalidate
31 * any dcookie values returned from get_dcookie().
33 void dcookie_unregister(struct dcookie_user * user);
35 /**
36 * get_dcookie - acquire a dcookie
38 * Convert the given dentry/vfsmount pair into
39 * a cookie value.
41 * Returns -EINVAL if no living task has registered as a
42 * dcookie user.
44 * Returns 0 on success, with *cookie filled in
46 int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
47 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 dentry * dentry,
62 struct vfsmount * vfsmnt, unsigned long * cookie)
64 return -ENOSYS;
67 #endif /* CONFIG_PROFILING */
69 #endif /* DCOOKIES_H */