1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
6 * This code is issued under the GNU General Public License.
7 * See the file COPYING in this distribution
9 * by Cluster File Systems, Inc.
14 #include <linux/version.h>
15 #include <linux/module.h>
16 #include <linux/slab.h>
17 #include <asm/unistd.h>
19 #define DEBUG_SUBSYSTEM S_LDLM
21 #include <linux/obd_support.h>
22 #include <linux/obd_class.h>
24 #include <linux/lustre_dlm.h>
26 static void ldlm_test_callback(struct ldlm_lock *lock, struct ldlm_lock *new)
28 printk("ldlm_test_callback: lock=%p, new=%p\n", lock, new);
31 int ldlm_test(struct obd_device *obddev)
33 struct ldlm_namespace *ns;
34 struct ldlm_resource *res;
35 __u64 res_id[RES_NAME_SIZE] = {1, 2, 3};
40 ns = ldlm_namespace_new(obddev, 1);
44 res = ldlm_resource_get(ns, NULL, res_id, 1);
48 res->lr_blocking = ldlm_test_callback;
50 /* Get a couple of read locks */
51 err = ldlm_local_lock_enqueue(obddev, 1, NULL, NULL, res_id, LCK_CR,
52 &flags, NULL, NULL, 0, NULL, &h);
56 err = ldlm_local_lock_enqueue(obddev, 1, NULL, NULL, res_id, LCK_CR,
57 &flags, NULL, NULL, 0, NULL, &h);
61 ldlm_resource_dump(res);