[XTENSA] Fix modules for non-exec processor configurations
[linux-block.git] / include / linux / dcookies.h
CommitLineData
1da177e4
LT
1/*
2 * dcookies.h
3 *
4 * Persistent cookie-path mappings
5 *
6 * Copyright 2002 John Levon <levon@movementarian.org>
7 */
8
9#ifndef DCOOKIES_H
10#define DCOOKIES_H
11
1da177e4
LT
12
13#ifdef CONFIG_PROFILING
14
1474855d 15#include <linux/dcache.h>
1da177e4
LT
16#include <linux/types.h>
17
18struct dcookie_user;
19
20/**
21 * dcookie_register - register a user of dcookies
22 *
23 * Register as a dcookie user. Returns %NULL on failure.
24 */
25struct dcookie_user * dcookie_register(void);
26
27/**
28 * dcookie_unregister - unregister a user of dcookies
29 *
30 * Unregister as a dcookie user. This may invalidate
31 * any dcookie values returned from get_dcookie().
32 */
33void dcookie_unregister(struct dcookie_user * user);
34
35/**
36 * get_dcookie - acquire a dcookie
37 *
38 * Convert the given dentry/vfsmount pair into
39 * a cookie value.
40 *
41 * Returns -EINVAL if no living task has registered as a
42 * dcookie user.
43 *
44 * Returns 0 on success, with *cookie filled in
45 */
46int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
47 unsigned long * cookie);
48
49#else
50
0072b138 51static inline struct dcookie_user * dcookie_register(void)
1da177e4
LT
52{
53 return NULL;
54}
55
0072b138 56static inline void dcookie_unregister(struct dcookie_user * user)
1da177e4
LT
57{
58 return;
59}
60
61static inline int get_dcookie(struct dentry * dentry,
62 struct vfsmount * vfsmnt, unsigned long * cookie)
63{
64 return -ENOSYS;
65}
66
67#endif /* CONFIG_PROFILING */
68
69#endif /* DCOOKIES_H */