1 #ifndef __LUSTRE_HANDLES_H_
2 #define __LUSTRE_HANDLES_H_
5 #include <linux/lustre_handles.h>
6 #elif defined(__APPLE__)
7 #include <darwin/lustre_handles.h>
8 #elif defined(__WINNT__)
9 #include <winnt/lustre_handles.h>
11 #error Unsupported operating system.
14 typedef void (*portals_handle_addref_cb)(void *object);
16 /* These handles are most easily used by having them appear at the very top of
17 * whatever object that you want to make handles for. ie:
20 * struct portals_handle handle;
24 * Now you're able to assign the results of cookie2handle directly to an
25 * ldlm_lock. If it's not at the top, you'll want to hack up a macro that
26 * uses some offsetof() magic. */
28 struct portals_handle {
29 struct list_head h_link;
31 portals_handle_addref_cb h_addref;
36 /* Add a handle to the hash table */
37 void class_handle_hash(struct portals_handle *, portals_handle_addref_cb);
38 void class_handle_unhash(struct portals_handle *);
39 void class_handle_hash_back(struct portals_handle *);
40 void *class_handle2object(__u64 cookie);
41 int class_handle_init(void);
42 void class_handle_cleanup(void);