#ifdef __KERNEL__
#include <linux/proc_fs.h>
-#include <linux/obd_class.h>
#include <linux/lustre_net.h>
+struct obd_ops;
+struct obd_export;
+struct obd_device;
+
#define OBD_LDLM_DEVICENAME "ldlm"
typedef enum {
void *w_data;
int w_datalen;
};
+
+/* Per-export ldlm state. */
+struct ldlm_export_data {
+ struct list_head led_held_locks;
+};
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);
#include <linux/lustre_lib.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
+#include <linux/lustre_dlm.h>
#endif
struct obd_device *exp_obd;
struct ptlrpc_connection *exp_connection;
struct mds_export_data exp_mds_data;
-#if NOTYET && 0
struct ldlm_export_data exp_ldlm_data;
+#if NOTYET && 0
struct ost_export_data exp_ost_data;
#endif
void *exp_data; /* device specific data */
#include <linux/random.h>
#include <linux/lustre_dlm.h>
#include <linux/lustre_mds.h>
+#include <linux/obd_class.h>
/* lock types */
char *ldlm_lockname[] = {
return;
}
+ list_del(&lock->l_export_chain);
+ lock->l_export = NULL;
lock->l_flags = LDLM_FL_DESTROYED;
+
l_unlock(&lock->l_resource->lr_namespace->ns_lock);
LDLM_LOCK_PUT(lock);
EXIT;
return retval;
}
-
-
-
static int ldlm_plain_compat(struct ldlm_lock *a, struct ldlm_lock *b)
{
return lockmode_compat(a->l_req_mode, b->l_req_mode);
#include <linux/slab.h>
#include <linux/lustre_dlm.h>
#include <linux/init.h>
+#include <linux/obd_class.h>
extern kmem_cache_t *ldlm_resource_slab;
extern kmem_cache_t *ldlm_lock_slab;
waiting_locks_timer.expires);
mod_timer(&waiting_locks_timer, timeout_rounded);
}
- list_add(&lock->l_pending_chain, waiting_locks_list.prev); /* FIFO */
+ list_add_tail(&lock->l_pending_chain, &waiting_locks_list); /* FIFO */
spin_unlock_bh(&waiting_locks_spinlock);
RETURN(1);
}
}
lock->l_export = req->rq_export;
+ if (lock->l_export) {
+ l_lock(&lock->l_resource->lr_namespace->ns_lock);
+ list_add(&lock->l_export_chain,
+ &lock->l_export->exp_ldlm_data.led_held_locks);
+ l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+ }
+
ptlrpc_connection_addref(req->rq_connection);
EXIT;
out:
#include <linux/lustre_mds.h>
#include <linux/lustre_dlm.h>
#include <linux/init.h>
+#include <linux/obd_class.h>
extern int mds_get_lovtgts(struct obd_device *obd, int tgt_count,
uuid_t *uuidarray);
memset(export, 0, sizeof(*export));
get_random_bytes(&export->exp_cookie, sizeof(__u64));
export->exp_obd = obddev;
+ /* XXX should these be in MDS and LDLM init functions? */
INIT_LIST_HEAD(&export->exp_mds_data.med_open_head);
+ INIT_LIST_HEAD(&export->exp_ldlm_data.led_held_locks);
list_add(&(export->exp_chain), &export->exp_obd->obd_exports);
return export;
}