Skip to content

Commit

Permalink
ocfs2-dlm-optimization-of-code-while-free-dead-node-locks-checkpatch-…
Browse files Browse the repository at this point in the history
…fixes

WARNING: please, no spaces at the start of a line
torvalds#26: FILE: fs/ocfs2/dlm/dlmrecovery.c:2271:
+       struct list_head *queue = NULL;$

WARNING: please, no spaces at the start of a line
torvalds#27: FILE: fs/ocfs2/dlm/dlmrecovery.c:2272:
+       int i;$

WARNING: please, no spaces at the start of a line
torvalds#60: FILE: fs/ocfs2/dlm/dlmrecovery.c:2285:
+       for (i = DLM_GRANTED_LIST; i <= DLM_BLOCKED_LIST; i++) {$

WARNING: suspect code indent for conditional statements (7, 15)
torvalds#60: FILE: fs/ocfs2/dlm/dlmrecovery.c:2285:
+       for (i = DLM_GRANTED_LIST; i <= DLM_BLOCKED_LIST; i++) {
+               queue = dlm_list_idx_to_ptr(res, i);

ERROR: code indent should use tabs where possible
torvalds#61: FILE: fs/ocfs2/dlm/dlmrecovery.c:2286:
+               queue = dlm_list_idx_to_ptr(res, i);$

WARNING: please, no spaces at the start of a line
torvalds#61: FILE: fs/ocfs2/dlm/dlmrecovery.c:2286:
+               queue = dlm_list_idx_to_ptr(res, i);$

ERROR: code indent should use tabs where possible
torvalds#62: FILE: fs/ocfs2/dlm/dlmrecovery.c:2287:
+               list_for_each_entry_safe(lock, next, queue, list) {$

WARNING: please, no spaces at the start of a line
torvalds#62: FILE: fs/ocfs2/dlm/dlmrecovery.c:2287:
+               list_for_each_entry_safe(lock, next, queue, list) {$

WARNING: suspect code indent for conditional statements (15, 23)
torvalds#62: FILE: fs/ocfs2/dlm/dlmrecovery.c:2287:
+               list_for_each_entry_safe(lock, next, queue, list) {
+                       if (lock->ml.node == dead_node) {

ERROR: code indent should use tabs where possible
torvalds#63: FILE: fs/ocfs2/dlm/dlmrecovery.c:2288:
+                       if (lock->ml.node == dead_node) {$

WARNING: please, no spaces at the start of a line
torvalds#63: FILE: fs/ocfs2/dlm/dlmrecovery.c:2288:
+                       if (lock->ml.node == dead_node) {$

WARNING: suspect code indent for conditional statements (23, 31)
torvalds#63: FILE: fs/ocfs2/dlm/dlmrecovery.c:2288:
+                       if (lock->ml.node == dead_node) {
+                               list_del_init(&lock->list);

ERROR: code indent should use tabs where possible
torvalds#64: FILE: fs/ocfs2/dlm/dlmrecovery.c:2289:
+                               list_del_init(&lock->list);$

WARNING: please, no spaces at the start of a line
torvalds#64: FILE: fs/ocfs2/dlm/dlmrecovery.c:2289:
+                               list_del_init(&lock->list);$

ERROR: code indent should use tabs where possible
torvalds#65: FILE: fs/ocfs2/dlm/dlmrecovery.c:2290:
+                               dlm_lock_put(lock);$

WARNING: please, no spaces at the start of a line
torvalds#65: FILE: fs/ocfs2/dlm/dlmrecovery.c:2290:
+                               dlm_lock_put(lock);$

ERROR: code indent should use tabs where possible
torvalds#66: FILE: fs/ocfs2/dlm/dlmrecovery.c:2291:
+                               /* Can't schedule DLM_UNLOCK_FREE_LOCK$

ERROR: code indent should use tabs where possible
torvalds#67: FILE: fs/ocfs2/dlm/dlmrecovery.c:2292:
+                                * do manually$

ERROR: code indent should use tabs where possible
torvalds#68: FILE: fs/ocfs2/dlm/dlmrecovery.c:2293:
+                                */$

ERROR: code indent should use tabs where possible
torvalds#69: FILE: fs/ocfs2/dlm/dlmrecovery.c:2294:
+                               dlm_lock_put(lock);$

WARNING: please, no spaces at the start of a line
torvalds#69: FILE: fs/ocfs2/dlm/dlmrecovery.c:2294:
+                               dlm_lock_put(lock);$

ERROR: code indent should use tabs where possible
#70: FILE: fs/ocfs2/dlm/dlmrecovery.c:2295:
+                               freed++;$

WARNING: please, no spaces at the start of a line
#70: FILE: fs/ocfs2/dlm/dlmrecovery.c:2295:
+                               freed++;$

ERROR: code indent should use tabs where possible
torvalds#71: FILE: fs/ocfs2/dlm/dlmrecovery.c:2296:
+                       }$

WARNING: please, no spaces at the start of a line
torvalds#71: FILE: fs/ocfs2/dlm/dlmrecovery.c:2296:
+                       }$

total: 11 errors, 14 warnings, 51 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

NOTE: Whitespace errors detected.
      You may wish to use scripts/cleanpatch or scripts/cleanfile

./patches/ocfs2-dlm-optimization-of-code-while-free-dead-node-locks.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Guozhonghua <guozhonghua@h3c.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and sfrothwell committed May 14, 2017
1 parent 4d341b7 commit f7be99e
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions fs/ocfs2/dlm/dlmrecovery.c
Expand Up @@ -2268,8 +2268,8 @@ static void dlm_free_dead_locks(struct dlm_ctxt *dlm,
{
struct dlm_lock *lock, *next;
unsigned int freed = 0;
struct list_head *queue = NULL;
int i;
struct list_head *queue = NULL;
int i;

/* this node is the lockres master:
* 1) remove any stale locks for the dead node
Expand All @@ -2282,18 +2282,19 @@ static void dlm_free_dead_locks(struct dlm_ctxt *dlm,
* to force the DLM_UNLOCK_FREE_LOCK action so as to free the locks */

/* TODO: check pending_asts, pending_basts here */
for (i = DLM_GRANTED_LIST; i <= DLM_BLOCKED_LIST; i++) {
queue = dlm_list_idx_to_ptr(res, i);
list_for_each_entry_safe(lock, next, queue, list) {
if (lock->ml.node == dead_node) {
list_del_init(&lock->list);
dlm_lock_put(lock);
/* Can't schedule DLM_UNLOCK_FREE_LOCK
* do manually
*/
dlm_lock_put(lock);
freed++;
}
for (i = DLM_GRANTED_LIST; i <= DLM_BLOCKED_LIST; i++) {
queue = dlm_list_idx_to_ptr(res, i);
list_for_each_entry_safe(lock, next, queue, list) {
if (lock->ml.node == dead_node) {
list_del_init(&lock->list);
dlm_lock_put(lock);
/*
* Can't schedule DLM_UNLOCK_FREE_LOCK: do
* manually
*/
dlm_lock_put(lock);
freed++;
}
}
}

Expand Down

0 comments on commit f7be99e

Please sign in to comment.