From 4f6be250fdfa6530886597d13d3d1377c90e20a7 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Thu, 21 Mar 2019 02:49:42 +0530 Subject: [PATCH] LU-6142 ldlm: Fix style issues for ldlm_plain.c This patch fixes issues reported by checkpatch for file lustre/ldlm/ldlm_plain.c Test-Parameters: trivial Change-Id: I2f614a62d7ca1b350766f7981991218d76b26e27 Signed-off-by: Arshad Hussain Reviewed-on: https://review.whamcloud.com/34491 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons --- lustre/ldlm/ldlm_plain.c | 66 +++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/lustre/ldlm/ldlm_plain.c b/lustre/ldlm/ldlm_plain.c index 6407fd2..fe27db4 100644 --- a/lustre/ldlm/ldlm_plain.c +++ b/lustre/ldlm/ldlm_plain.c @@ -71,15 +71,17 @@ ldlm_plain_compat_queue(struct list_head *queue, struct ldlm_lock *req, enum ldlm_mode req_mode = req->l_req_mode; struct ldlm_lock *lock, *next_lock; int compat = 1; - ENTRY; + ENTRY; lockmode_verify(req_mode); list_for_each_entry_safe(lock, next_lock, queue, l_res_link) { - /* We stop walking the queue if we hit ourselves so we don't + /* + * We stop walking the queue if we hit ourselves so we don't * take conflicting locks enqueued after us into account, - * or we'd wait forever. */ + * or we'd wait forever. + */ if (req == lock) RETURN(compat); @@ -90,30 +92,32 @@ ldlm_plain_compat_queue(struct list_head *queue, struct ldlm_lock *req, struct ldlm_lock, l_res_link); if (lockmode_compat(lock->l_req_mode, req_mode)) - continue; + continue; - if (!work_list) - RETURN(0); + if (!work_list) + RETURN(0); - compat = 0; + compat = 0; - /* Add locks of the mode group to \a work_list as - * blocking locks for \a req. */ - if (lock->l_blocking_ast) - ldlm_add_ast_work_item(lock, req, work_list); + /* + * Add locks of the mode group to \a work_list as + * blocking locks for \a req. + */ + if (lock->l_blocking_ast) + ldlm_add_ast_work_item(lock, req, work_list); - { + { struct list_head *head; - head = &lock->l_sl_mode; + head = &lock->l_sl_mode; list_for_each_entry(lock, head, l_sl_mode) - if (lock->l_blocking_ast) - ldlm_add_ast_work_item(lock, req, - work_list); - } - } + if (lock->l_blocking_ast) + ldlm_add_ast_work_item(lock, req, + work_list); + } + } - RETURN(compat); + RETURN(compat); } /** @@ -132,25 +136,25 @@ int ldlm_process_plain_lock(struct ldlm_lock *lock, __u64 *flags, struct list_head *grant_work = intention == LDLM_PROCESS_ENQUEUE ? NULL : work_list; int rc; - ENTRY; + ENTRY; LASSERT(!ldlm_is_granted(lock)); check_res_locked(res); *err = ELDLM_OK; if (intention == LDLM_PROCESS_RESCAN) { - LASSERT(work_list != NULL); - rc = ldlm_plain_compat_queue(&res->lr_granted, lock, NULL); - if (!rc) - RETURN(LDLM_ITER_STOP); - rc = ldlm_plain_compat_queue(&res->lr_waiting, lock, NULL); - if (!rc) - RETURN(LDLM_ITER_STOP); - - ldlm_resource_unlink_lock(lock); + LASSERT(work_list != NULL); + rc = ldlm_plain_compat_queue(&res->lr_granted, lock, NULL); + if (!rc) + RETURN(LDLM_ITER_STOP); + rc = ldlm_plain_compat_queue(&res->lr_waiting, lock, NULL); + if (!rc) + RETURN(LDLM_ITER_STOP); + + ldlm_resource_unlink_lock(lock); ldlm_grant_lock(lock, grant_work); - RETURN(LDLM_ITER_CONTINUE); - } + RETURN(LDLM_ITER_CONTINUE); + } rc = ldlm_plain_compat_queue(&res->lr_granted, lock, work_list); rc += ldlm_plain_compat_queue(&res->lr_waiting, lock, work_list); -- 1.8.3.1