Commit 986dbb58 authored by Andreas Dilger's avatar Andreas Dilger Committed by Greg Kroah-Hartman

staging: lustre: ldlm: change "int" to proper enum type

Fix users of flags that were using "int" instead of named enum.
Rename some "flags" variables to distinguish between different flags.
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarfrank zago <fzago@cray.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 581b75c2
...@@ -965,8 +965,8 @@ struct ldlm_ast_work { ...@@ -965,8 +965,8 @@ struct ldlm_ast_work {
* Common ldlm_enqueue parameters * Common ldlm_enqueue parameters
*/ */
struct ldlm_enqueue_info { struct ldlm_enqueue_info {
__u32 ei_type; /** Type of the lock being enqueued. */ enum ldlm_type ei_type; /** Type of the lock being enqueued. */
__u32 ei_mode; /** Mode of the lock being enqueued. */ enum ldlm_mode ei_mode; /** Mode of the lock being enqueued. */
void *ei_cb_bl; /** blocking lock callback */ void *ei_cb_bl; /** blocking lock callback */
void *ei_cb_cp; /** lock completion callback */ void *ei_cb_cp; /** lock completion callback */
void *ei_cb_gl; /** lock glimpse callback */ void *ei_cb_gl; /** lock glimpse callback */
...@@ -1166,10 +1166,12 @@ do { \ ...@@ -1166,10 +1166,12 @@ do { \
struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock); struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock);
void ldlm_lock_put(struct ldlm_lock *lock); void ldlm_lock_put(struct ldlm_lock *lock);
void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc); void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc);
void ldlm_lock_addref(const struct lustre_handle *lockh, __u32 mode); void ldlm_lock_addref(const struct lustre_handle *lockh, enum ldlm_mode mode);
int ldlm_lock_addref_try(const struct lustre_handle *lockh, __u32 mode); int ldlm_lock_addref_try(const struct lustre_handle *lockh,
void ldlm_lock_decref(const struct lustre_handle *lockh, __u32 mode); enum ldlm_mode mode);
void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh, __u32 mode); void ldlm_lock_decref(const struct lustre_handle *lockh, enum ldlm_mode mode);
void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh,
enum ldlm_mode mode);
void ldlm_lock_fail_match_locked(struct ldlm_lock *lock); void ldlm_lock_fail_match_locked(struct ldlm_lock *lock);
void ldlm_lock_allow_match(struct ldlm_lock *lock); void ldlm_lock_allow_match(struct ldlm_lock *lock);
void ldlm_lock_allow_match_locked(struct ldlm_lock *lock); void ldlm_lock_allow_match_locked(struct ldlm_lock *lock);
......
...@@ -138,10 +138,10 @@ ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *, ...@@ -138,10 +138,10 @@ ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *,
void *data, __u32 lvb_len, enum lvb_type lvb_type); void *data, __u32 lvb_len, enum lvb_type lvb_type);
enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **, enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
void *cookie, __u64 *flags); void *cookie, __u64 *flags);
void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode); void ldlm_lock_addref_internal(struct ldlm_lock *, enum ldlm_mode mode);
void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, __u32 mode); void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode);
void ldlm_lock_decref_internal(struct ldlm_lock *, __u32 mode); void ldlm_lock_decref_internal(struct ldlm_lock *, enum ldlm_mode mode);
void ldlm_lock_decref_internal_nolock(struct ldlm_lock *, __u32 mode); void ldlm_lock_decref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode);
int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list, int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
enum ldlm_desc_ast_t ast_type); enum ldlm_desc_ast_t ast_type);
int ldlm_lock_remove_from_lru_check(struct ldlm_lock *lock, time_t last_use); int ldlm_lock_remove_from_lru_check(struct ldlm_lock *lock, time_t last_use);
......
...@@ -643,7 +643,7 @@ static void ldlm_add_ast_work_item(struct ldlm_lock *lock, ...@@ -643,7 +643,7 @@ static void ldlm_add_ast_work_item(struct ldlm_lock *lock,
* r/w reference type is determined by \a mode * r/w reference type is determined by \a mode
* Calls ldlm_lock_addref_internal. * Calls ldlm_lock_addref_internal.
*/ */
void ldlm_lock_addref(const struct lustre_handle *lockh, __u32 mode) void ldlm_lock_addref(const struct lustre_handle *lockh, enum ldlm_mode mode)
{ {
struct ldlm_lock *lock; struct ldlm_lock *lock;
...@@ -661,7 +661,8 @@ EXPORT_SYMBOL(ldlm_lock_addref); ...@@ -661,7 +661,8 @@ EXPORT_SYMBOL(ldlm_lock_addref);
* Removes lock from LRU if it is there. * Removes lock from LRU if it is there.
* Assumes the LDLM lock is already locked. * Assumes the LDLM lock is already locked.
*/ */
void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock, __u32 mode) void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock,
enum ldlm_mode mode)
{ {
ldlm_lock_remove_from_lru(lock); ldlm_lock_remove_from_lru(lock);
if (mode & (LCK_NL | LCK_CR | LCK_PR)) { if (mode & (LCK_NL | LCK_CR | LCK_PR)) {
...@@ -685,7 +686,7 @@ void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock, __u32 mode) ...@@ -685,7 +686,7 @@ void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock, __u32 mode)
* *
* \retval -EAGAIN lock is being canceled. * \retval -EAGAIN lock is being canceled.
*/ */
int ldlm_lock_addref_try(const struct lustre_handle *lockh, __u32 mode) int ldlm_lock_addref_try(const struct lustre_handle *lockh, enum ldlm_mode mode)
{ {
struct ldlm_lock *lock; struct ldlm_lock *lock;
int result; int result;
...@@ -711,7 +712,7 @@ EXPORT_SYMBOL(ldlm_lock_addref_try); ...@@ -711,7 +712,7 @@ EXPORT_SYMBOL(ldlm_lock_addref_try);
* Locks LDLM lock and calls ldlm_lock_addref_internal_nolock to do the work. * Locks LDLM lock and calls ldlm_lock_addref_internal_nolock to do the work.
* Only called for local locks. * Only called for local locks.
*/ */
void ldlm_lock_addref_internal(struct ldlm_lock *lock, __u32 mode) void ldlm_lock_addref_internal(struct ldlm_lock *lock, enum ldlm_mode mode)
{ {
lock_res_and_lock(lock); lock_res_and_lock(lock);
ldlm_lock_addref_internal_nolock(lock, mode); ldlm_lock_addref_internal_nolock(lock, mode);
...@@ -725,7 +726,8 @@ void ldlm_lock_addref_internal(struct ldlm_lock *lock, __u32 mode) ...@@ -725,7 +726,8 @@ void ldlm_lock_addref_internal(struct ldlm_lock *lock, __u32 mode)
* Does NOT add lock to LRU if no r/w references left to accommodate flock locks * Does NOT add lock to LRU if no r/w references left to accommodate flock locks
* that cannot be placed in LRU. * that cannot be placed in LRU.
*/ */
void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, __u32 mode) void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock,
enum ldlm_mode mode)
{ {
LDLM_DEBUG(lock, "ldlm_lock_decref(%s)", ldlm_lockname[mode]); LDLM_DEBUG(lock, "ldlm_lock_decref(%s)", ldlm_lockname[mode]);
if (mode & (LCK_NL | LCK_CR | LCK_PR)) { if (mode & (LCK_NL | LCK_CR | LCK_PR)) {
...@@ -751,7 +753,7 @@ void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, __u32 mode) ...@@ -751,7 +753,7 @@ void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, __u32 mode)
* on the namespace. * on the namespace.
* For blocked LDLM locks if r/w count drops to zero, blocking_ast is called. * For blocked LDLM locks if r/w count drops to zero, blocking_ast is called.
*/ */
void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) void ldlm_lock_decref_internal(struct ldlm_lock *lock, enum ldlm_mode mode)
{ {
struct ldlm_namespace *ns; struct ldlm_namespace *ns;
...@@ -822,7 +824,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) ...@@ -822,7 +824,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode)
/** /**
* Decrease reader/writer refcount for LDLM lock with handle \a lockh * Decrease reader/writer refcount for LDLM lock with handle \a lockh
*/ */
void ldlm_lock_decref(const struct lustre_handle *lockh, __u32 mode) void ldlm_lock_decref(const struct lustre_handle *lockh, enum ldlm_mode mode)
{ {
struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0); struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0);
...@@ -837,7 +839,8 @@ EXPORT_SYMBOL(ldlm_lock_decref); ...@@ -837,7 +839,8 @@ EXPORT_SYMBOL(ldlm_lock_decref);
* \a lockh and mark it for subsequent cancellation once r/w refcount * \a lockh and mark it for subsequent cancellation once r/w refcount
* drops to zero instead of putting into LRU. * drops to zero instead of putting into LRU.
*/ */
void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh, __u32 mode) void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh,
enum ldlm_mode mode)
{ {
struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0); struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment