[POWERPC] Fix return from pte_alloc_one() in out-of-memory case
[linux-2.6/mini2440.git] / include / linux / dcookies.h
blob0fe7cdf326f735c0722ffc08443cbcf993991fca
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/types.h>
17 struct dcookie_user;
19 /**
20 * dcookie_register - register a user of dcookies
22 * Register as a dcookie user. Returns %NULL on failure.
24 struct dcookie_user * dcookie_register(void);
26 /**
27 * dcookie_unregister - unregister a user of dcookies
29 * Unregister as a dcookie user. This may invalidate
30 * any dcookie values returned from get_dcookie().
32 void dcookie_unregister(struct dcookie_user * user);
34 /**
35 * get_dcookie - acquire a dcookie
37 * Convert the given dentry/vfsmount pair into
38 * a cookie value.
40 * Returns -EINVAL if no living task has registered as a
41 * dcookie user.
43 * Returns 0 on success, with *cookie filled in
45 int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
46 unsigned long * cookie);
48 #else
50 static inline struct dcookie_user * dcookie_register(void)
52 return NULL;
55 static inline void dcookie_unregister(struct dcookie_user * user)
57 return;
60 static inline int get_dcookie(struct dentry * dentry,
61 struct vfsmount * vfsmnt, unsigned long * cookie)
63 return -ENOSYS;
66 #endif /* CONFIG_PROFILING */
68 #endif /* DCOOKIES_H */