Linux Audio

Check our new training course

Open-source upstreaming

Need help get the support for your hardware in upstream Linux?
Loading...
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * dcookies.h
 4 *
 5 * Persistent cookie-path mappings
 6 *
 7 * Copyright 2002 John Levon <levon@movementarian.org>
 8 */
 9
10#ifndef DCOOKIES_H
11#define DCOOKIES_H
12 
13
14#ifdef CONFIG_PROFILING
15 
16#include <linux/dcache.h>
17#include <linux/types.h>
18 
19struct dcookie_user;
20struct path;
21 
22/**
23 * dcookie_register - register a user of dcookies
24 *
25 * Register as a dcookie user. Returns %NULL on failure.
26 */
27struct dcookie_user * dcookie_register(void);
28
29/**
30 * dcookie_unregister - unregister a user of dcookies
31 *
32 * Unregister as a dcookie user. This may invalidate
33 * any dcookie values returned from get_dcookie().
34 */
35void dcookie_unregister(struct dcookie_user * user);
36  
37/**
38 * get_dcookie - acquire a dcookie
39 *
40 * Convert the given dentry/vfsmount pair into
41 * a cookie value.
42 *
43 * Returns -EINVAL if no living task has registered as a
44 * dcookie user.
45 *
46 * Returns 0 on success, with *cookie filled in
47 */
48int get_dcookie(const struct path *path, unsigned long *cookie);
49
50#else
51
52static inline struct dcookie_user * dcookie_register(void)
53{
54	return NULL;
55}
56
57static inline void dcookie_unregister(struct dcookie_user * user)
58{
59	return;
60}
61
62static inline int get_dcookie(const struct path *path, unsigned long *cookie)
63{
64	return -ENOSYS;
65}
66
67#endif /* CONFIG_PROFILING */
68
69#endif /* DCOOKIES_H */
v3.5.6
 
 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 
12
13#ifdef CONFIG_PROFILING
14 
15#include <linux/dcache.h>
16#include <linux/types.h>
17 
18struct dcookie_user;
19struct path;
20 
21/**
22 * dcookie_register - register a user of dcookies
23 *
24 * Register as a dcookie user. Returns %NULL on failure.
25 */
26struct dcookie_user * dcookie_register(void);
27
28/**
29 * dcookie_unregister - unregister a user of dcookies
30 *
31 * Unregister as a dcookie user. This may invalidate
32 * any dcookie values returned from get_dcookie().
33 */
34void dcookie_unregister(struct dcookie_user * user);
35  
36/**
37 * get_dcookie - acquire a dcookie
38 *
39 * Convert the given dentry/vfsmount pair into
40 * a cookie value.
41 *
42 * Returns -EINVAL if no living task has registered as a
43 * dcookie user.
44 *
45 * Returns 0 on success, with *cookie filled in
46 */
47int get_dcookie(struct path *path, unsigned long *cookie);
48
49#else
50
51static inline struct dcookie_user * dcookie_register(void)
52{
53	return NULL;
54}
55
56static inline void dcookie_unregister(struct dcookie_user * user)
57{
58	return;
59}
60
61static inline int get_dcookie(struct path *path, unsigned long *cookie)
62{
63	return -ENOSYS;
64}
65
66#endif /* CONFIG_PROFILING */
67
68#endif /* DCOOKIES_H */