Whamcloud - gitweb
land 1.0.1 fixes on main development branch (head)
[fs/lustre-release.git] / lustre / ldlm / ldlm_internal.h
1 /* ldlm_request.c */
2 int ldlm_cancel_lru(struct ldlm_namespace *ns);
3
4 /* ldlm_lock.c */
5 void ldlm_grant_lock(struct ldlm_lock *lock, void *data, int datalen,
6                      int run_ast);
7 struct ldlm_lock *
8 ldlm_lock_create(struct ldlm_namespace *ns,
9                  struct lustre_handle *parent_lock_handle, struct ldlm_res_id,
10                  __u32 type, ldlm_mode_t, ldlm_blocking_callback,
11                  ldlm_completion_callback, void *data);
12 ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
13                                void *cookie, int cookie_len, int *flags);
14 void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode);
15 void ldlm_lock_decref_internal(struct ldlm_lock *, __u32 mode);
16 void ldlm_add_ast_work_item(struct ldlm_lock *lock, struct ldlm_lock *new,
17                             void *data, int datalen);
18 int ldlm_reprocess_queue(struct ldlm_resource *res, struct list_head *queue);
19 int ldlm_run_ast_work(struct ldlm_namespace *, struct list_head *rpc_list);
20
21 typedef int (*ldlm_processing_policy)(struct ldlm_lock *lock, int *flags,
22                                       int first_enq, ldlm_error_t *err);
23
24 /* ldlm_plain.c */
25 int ldlm_process_plain_lock(struct ldlm_lock *lock, int *flags, int first_enq,
26                             ldlm_error_t *err);
27
28 /* ldlm_extent.c */
29 int ldlm_process_extent_lock(struct ldlm_lock *lock, int *flags, int first_enq,
30                              ldlm_error_t *err);
31
32 /* ldlm_flock.c */
33 int ldlm_process_flock_lock(struct ldlm_lock *lock, int *flags, int first_enq,
34                             ldlm_error_t *err);
35
36 /* l_lock.c */
37 void l_check_no_ns_lock(struct ldlm_namespace *ns);
38
39 extern struct proc_dir_entry *ldlm_svc_proc_dir;
40
41 struct ldlm_state {
42         struct ptlrpc_service *ldlm_cb_service;
43         struct ptlrpc_service *ldlm_cancel_service;
44         struct ptlrpc_client *ldlm_client;
45         struct ptlrpc_connection *ldlm_server_conn;
46         struct ldlm_bl_pool *ldlm_bl_pool;
47 };
48
49 int ldlm_init(void);
50 void ldlm_exit(void);
51