From b3d298faaa9e2e2f619c6bb607d5e0808e98f9a3 Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 28 Oct 2002 01:18:30 +0000 Subject: [PATCH] - Pass flags into lock policy function --- lustre/include/linux/lustre_dlm.h | 7 ++++--- lustre/ldlm/ldlm_extent.c | 2 +- lustre/ldlm/ldlm_lock.c | 4 ++-- lustre/mds/handler.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index 791f425..187605f 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -159,7 +159,7 @@ struct ldlm_lock { typedef int (*ldlm_res_compat)(struct ldlm_lock *child, struct ldlm_lock *new); typedef int (*ldlm_res_policy)(struct ldlm_lock *lock, void *req_cookie, - ldlm_mode_t mode, void *data); + ldlm_mode_t mode, int flags, void *data); #define LDLM_PLAIN 10 #define LDLM_EXTENT 11 @@ -267,7 +267,8 @@ do { \ /* ldlm_extent.c */ int ldlm_extent_compat(struct ldlm_lock *, struct ldlm_lock *); -int ldlm_extent_policy(struct ldlm_lock *, void *, ldlm_mode_t, void *); +int ldlm_extent_policy(struct ldlm_lock *, void *, ldlm_mode_t, int flags, + void *); /* ldlm_lockd.c */ int ldlm_handle_enqueue(struct ptlrpc_request *req); @@ -277,7 +278,7 @@ int ldlm_del_waiting_lock(struct ldlm_lock *lock); /* ldlm_lock.c */ void ldlm_register_intent(int (*arg)(struct ldlm_lock *lock, void *req_cookie, - ldlm_mode_t mode, void *data)); + ldlm_mode_t mode, int flags, 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 *, int strict); diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 1f952cd..468eb2b 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -68,7 +68,7 @@ static void policy_internal(struct list_head *queue, struct ldlm_extent *req_ex, /* apply the internal policy by walking all the lists */ int ldlm_extent_policy(struct ldlm_lock *lock, void *req_cookie, - ldlm_mode_t mode, void *data) + ldlm_mode_t mode, int flags, void *data) { struct ldlm_resource *res = lock->l_resource; struct ldlm_extent *req_ex = req_cookie; diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 7e0e93c..2bf4fa71 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -108,7 +108,7 @@ ldlm_res_policy ldlm_res_policy_table[] = { }; void ldlm_register_intent(int (*arg) (struct ldlm_lock * lock, void *req_cookie, - ldlm_mode_t mode, void *data)) + ldlm_mode_t mode, int flags, void *data)) { ldlm_res_policy_table[LDLM_MDSINTENT] = arg; } @@ -678,7 +678,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_lock * lock, if (!local && !(*flags & LDLM_FL_REPLAY) && (policy = ldlm_res_policy_table[res->lr_type])) { int rc; - rc = policy(lock, cookie, lock->l_req_mode, NULL); + rc = policy(lock, cookie, lock->l_req_mode, *flags, NULL); if (rc == ELDLM_LOCK_CHANGED) { res = lock->l_resource; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 4629542..57919c6 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1302,7 +1302,7 @@ static int mds_cleanup(struct obd_device *obddev) } static int ldlm_intent_policy(struct ldlm_lock *lock, void *req_cookie, - ldlm_mode_t mode, void *data) + ldlm_mode_t mode, int flags, void *data) { struct ptlrpc_request *req = req_cookie; int rc = 0; -- 1.8.3.1