#ifdef __KERNEL__
#include <linux/proc_fs.h>
-#include <linux/obd_class.h>
+#include <linux/lustre_lib.h>
#include <linux/lustre_net.h>
+#include <linux/lustre_import.h>
+
+struct obd_ops;
+struct obd_device;
#define OBD_LDLM_DEVICENAME "ldlm"
struct ldlm_namespace {
char *ns_name;
- struct ptlrpc_client ns_rpc_client;/* used for revocation callbacks */
__u32 ns_client; /* is this a client-side lock tree? */
struct list_head *ns_hash; /* hash table for ns */
__u32 ns_refcount; /* count of resources in the hash */
struct list_head l_children;
struct list_head l_childof;
struct list_head l_res_link; /*position in one of three res lists*/
- struct list_head l_inode_link; /* position in inode info list */
+ struct list_head l_export_chain; /* per-export chain of locks */
+ struct list_head l_pending_chain; /* locks with callbacks pending*/
+ unsigned long l_callback_timeout;
ldlm_mode_t l_req_mode;
ldlm_mode_t l_granted_mode;
ldlm_blocking_callback l_blocking_ast;
struct obd_export *l_export;
- struct ptlrpc_client *l_client;
struct lustre_handle *l_connh;
__u32 l_flags;
- struct lustre_handle l_remote_handle;
+ struct lustre_handle l_remote_handle;
void *l_data;
__u32 l_data_len;
void *l_cookie;
void *w_data;
int w_datalen;
};
+
+/* Per-export ldlm state. */
+struct ldlm_export_data {
+ struct list_head led_held_locks;
+ struct obd_import led_import;
+};
static inline struct ldlm_extent *ldlm_res2extent(struct ldlm_resource *res)
{
extern struct obd_ops ldlm_obd_ops;
-
extern char *ldlm_lockname[];
extern char *ldlm_typename[];
extern char *ldlm_it2str(int it);
lock; \
})
+struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock);
void ldlm_lock_put(struct ldlm_lock *lock);
void ldlm_lock_destroy(struct ldlm_lock *lock);
void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc);
/* ldlm_test.c */
int ldlm_test(struct obd_device *device, struct lustre_handle *connh);
int ldlm_regression_start(struct obd_device *obddev,
- struct lustre_handle *connh, int count);
+ struct lustre_handle *connh,
+ unsigned int threads, unsigned int max_locks_in,
+ unsigned int num_resources_in,
+ unsigned int num_extents_in);
int ldlm_regression_stop(void);
void *data, __u32 data_len);
int ldlm_cli_convert(struct lustre_handle *, int new_mode, int *flags);
int ldlm_cli_cancel(struct lustre_handle *lockh);
+int ldlm_cli_cancel_unused(struct ldlm_namespace *ns, __u64 *res_id);
/* mds/handler.c */
/* This has to be here because recurisve inclusion sucks. */