From 253db579d88e4ea13dd84273820772d7d4903c36 Mon Sep 17 00:00:00 2001 From: nikita Date: Sat, 27 May 2006 17:42:43 +0000 Subject: [PATCH] constification --- lustre/include/lustre_dlm.h | 7 ++++--- lustre/ldlm/ldlm_internal.h | 3 ++- lustre/ldlm/ldlm_lock.c | 12 +++++++----- lustre/ldlm/ldlm_lockd.c | 3 ++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index f68fca4..98b5044 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -467,13 +467,14 @@ void ldlm_put_ref(int force); /* ldlm_lock.c */ ldlm_processing_policy ldlm_get_processing_policy(struct ldlm_resource *res); void ldlm_register_intent(struct ldlm_namespace *ns, ldlm_res_policy arg); -void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh); -struct ldlm_lock *__ldlm_handle2lock(struct lustre_handle *, int flags); +void ldlm_lock2handle(const struct ldlm_lock *lock, + struct lustre_handle *lockh); +struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *, int flags); void ldlm_cancel_callback(struct ldlm_lock *); int ldlm_lock_set_data(struct lustre_handle *, void *data); void ldlm_lock_remove_from_lru(struct ldlm_lock *); struct ldlm_lock *ldlm_handle2lock_ns(struct ldlm_namespace *, - struct lustre_handle *); + const struct lustre_handle *); static inline struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *h) { diff --git a/lustre/ldlm/ldlm_internal.h b/lustre/ldlm/ldlm_internal.h index f9f6c43..7e7c000 100644 --- a/lustre/ldlm/ldlm_internal.h +++ b/lustre/ldlm/ldlm_internal.h @@ -19,7 +19,8 @@ void ldlm_grant_lock(struct ldlm_lock *lock, void *data, int datalen, int run_ast); struct ldlm_lock * ldlm_lock_create(struct ldlm_namespace *ns, - struct lustre_handle *parent_lock_handle, struct ldlm_res_id, + const struct lustre_handle *parent_lock_handle, + const struct ldlm_res_id, ldlm_type_t type, ldlm_mode_t, ldlm_blocking_callback, ldlm_completion_callback, ldlm_glimpse_callback, void *data, __u32 lvb_len); diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index e3df674..06ac10c 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -316,7 +316,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock, * HANDLES */ -void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh) +void ldlm_lock2handle(const struct ldlm_lock *lock, struct lustre_handle *lockh) { lockh->cookie = lock->l_handle.h_cookie; } @@ -325,7 +325,8 @@ void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh) * Return NULL if flag already set */ -struct ldlm_lock *__ldlm_handle2lock(struct lustre_handle *handle, int flags) +struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle, + int flags) { struct ldlm_namespace *ns; struct ldlm_lock *lock = NULL, *retval = NULL; @@ -367,7 +368,7 @@ struct ldlm_lock *__ldlm_handle2lock(struct lustre_handle *handle, int flags) } struct ldlm_lock *ldlm_handle2lock_ns(struct ldlm_namespace *ns, - struct lustre_handle *handle) + const struct lustre_handle *handle) { struct ldlm_lock *retval = NULL; @@ -789,8 +790,9 @@ int ldlm_lock_match(struct ldlm_namespace *ns, int flags, /* Returns a referenced lock */ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, - struct lustre_handle *parent_lock_handle, - struct ldlm_res_id res_id, ldlm_type_t type, + const struct lustre_handle *parent_lock_handle, + const struct ldlm_res_id res_id, + ldlm_type_t type, ldlm_mode_t mode, ldlm_blocking_callback blocking, ldlm_completion_callback completion, diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 274fe33..74f635b 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -633,7 +633,8 @@ int ldlm_server_glimpse_ast(struct ldlm_lock *lock, void *data) } static struct ldlm_lock * -find_existing_lock(struct obd_export *exp, struct lustre_handle *remote_hdl) +find_existing_lock(struct obd_export *exp, + const struct lustre_handle *remote_hdl) { struct obd_device *obd = exp->exp_obd; struct list_head *iter; -- 1.8.3.1