#define LDLM_FL_CBPENDING (1 << 4)
#define LDLM_FL_AST_SENT (1 << 5)
#define LDLM_FL_DESTROYED (1 << 6)
+#define LDLM_FL_WAIT_NOREPROC (1 << 7)
#define L2B(c) (1 << c)
struct ldlm_lock_desc *new, void *data,
__u32 data_len);
+typedef int (*ldlm_completion_callback)(struct ldlm_lock *lock, int flags);
+
struct ldlm_lock {
__u64 l_random;
int l_refc;
ldlm_mode_t l_req_mode;
ldlm_mode_t l_granted_mode;
- ldlm_lock_callback l_completion_ast;
+ ldlm_completion_callback l_completion_ast;
ldlm_lock_callback l_blocking_ast;
struct ptlrpc_connection *l_connection;
struct ptlrpc_client *l_client;
+ struct lustre_handle *l_connh;
__u32 l_flags;
struct lustre_handle l_remote_handle;
void *l_data;
int w_blocking;
struct ldlm_lock_desc w_desc;
struct list_head w_list;
+ int w_flags;
void *w_data;
int w_datalen;
};
extern char *ldlm_lockname[];
extern char *ldlm_typename[];
+extern char *ldlm_it2str(int it);
#define LDLM_DEBUG(lock, format, a...) \
do { \
int ldlm_extent_compat(struct ldlm_lock *, struct ldlm_lock *);
int ldlm_extent_policy(struct ldlm_lock *, void *, ldlm_mode_t, void *);
+/* ldlm_lockd.c */
+int ldlm_handle_enqueue(struct ptlrpc_request *req);
+int ldlm_handle_convert(struct ptlrpc_request *req);
+int ldlm_handle_cancel(struct ptlrpc_request *req);
+
/* ldlm_lock.c */
+void ldlm_register_intent(int (*arg)(struct ldlm_lock *lock, void *req_cookie,
+ ldlm_mode_t mode, void *data));
+void ldlm_unregister_intent(void);
void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh);
struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *handle);
void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh);
__u32 data_len);
ldlm_error_t ldlm_lock_enqueue(struct ldlm_lock *lock, void *cookie,
int cookie_len, int *flags,
- ldlm_lock_callback completion,
+ ldlm_completion_callback completion,
ldlm_lock_callback blocking);
struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
int *flags);
int ldlm_lock_change_resource(struct ldlm_lock *lock, __u64 new_resid[3]);
/* ldlm_request.c */
-int ldlm_cli_enqueue(struct ptlrpc_client *cl,
- struct ptlrpc_connection *peer,
- struct lustre_handle *connh,
+int ldlm_completion_ast(struct ldlm_lock *lock, int flags);
+int ldlm_cli_enqueue(struct lustre_handle *conn,
struct ptlrpc_request *req,
struct ldlm_namespace *ns,
struct lustre_handle *parent_lock_handle,
void *cookie, int cookielen,
ldlm_mode_t mode,
int *flags,
+ ldlm_completion_callback completion,
ldlm_lock_callback callback,
void *data,
__u32 data_len,
struct lustre_handle *lockh);
-int ldlm_match_or_enqueue(struct ptlrpc_client *cl,
- struct ptlrpc_connection *conn,
- struct lustre_handle *connh,
+int ldlm_match_or_enqueue(struct lustre_handle *connh,
struct ptlrpc_request *req,
struct ldlm_namespace *ns,
struct lustre_handle *parent_lock_handle,
void *cookie, int cookielen,
ldlm_mode_t mode,
int *flags,
+ ldlm_completion_callback completion,
ldlm_lock_callback callback,
void *data,
__u32 data_len,
struct lustre_handle *lockh);
int ldlm_server_ast(struct lustre_handle *lockh, struct ldlm_lock_desc *new,
void *data, __u32 data_len);
-int ldlm_cli_convert(struct ptlrpc_client *, struct lustre_handle *,
- struct lustre_handle *connh, int new_mode, int *flags);
+int ldlm_cli_convert(struct lustre_handle *, int new_mode, int *flags);
int ldlm_cli_cancel(struct lustre_handle *lockh);
#endif /* __KERNEL__ */