1 #ifndef _OSD_DYNLOCKS_H
2 #define _OSD_DYNLOCKS_H
4 #include <linux/list.h>
5 #include <linux/wait.h>
10 * - lock to protect this list
14 struct list_head dl_list;
15 spinlock_t dl_list_lock;
23 struct dynlock_handle {
25 struct list_head dh_list;
26 unsigned long dh_value; /* lock value */
27 int dh_refcount; /* number of users */
30 int dh_pid; /* holder of the lock */
31 wait_queue_head_t dh_wait;
34 void dynlock_init(struct dynlock *dl);
35 struct dynlock_handle *dynlock_lock(struct dynlock *dl, unsigned long value,
36 enum dynlock_type lt, gfp_t gfp);
37 void dynlock_unlock(struct dynlock *dl, struct dynlock_handle *lock);
38 int dynlock_is_locked(struct dynlock *dl, unsigned long value);