All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues
@ 2015-02-28 19:11 Haneen Mohammed
  2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:11 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patchset fixes the following coding style issues found by checkpatch.pl:
- Line over 80 charachters.
- Trailing statement should be on next line.
- Extern should be avoided in .c files.
- Else is not useful after return.
- Strings are generally beter as one

Haneen Mohammed (5):
  Staging: lustre: lustre: ldlm: Fix line over 80
  Staging: lustre: lustre: idlm: Move trailing statement to next line
  Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c
  Staging: lustre: lustre: ldlm: Remove unnecessary else after return
  Staging: lustre: lustre: ldlm: Concatenate strings into single string

 drivers/staging/lustre/lustre/ldlm/interval_tree.c |  9 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  2 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      |  4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 56 ++++++++++++++--------
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    | 29 ++++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     | 20 ++++----
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 +++--
 9 files changed, 84 insertions(+), 54 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters
  2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
@ 2015-02-28 19:17 ` Haneen Mohammed
  2015-02-28 20:01   ` [Outreachy kernel] " Julia Lawall
  2015-02-28 19:20 ` [PATCH 2/5] Staging: lustre: lustre: idlm: Move trailing statement to next line Haneen Mohammed
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:17 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patch splits line over 80 characters addressing checkpatch.pl
warning.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/interval_tree.c |  9 +++--
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 46 +++++++++++++++-------
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    | 12 ++++--
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     | 11 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 ++++--
 6 files changed, 62 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
index eab2bd6..1b2bf08 100644
--- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c
+++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
@@ -433,7 +433,8 @@ static void interval_erase_color(struct interval_node *node,
 
 					o_left = tmp->in_left;
 					if (o_left)
-						o_left->in_color = INTERVAL_BLACK;
+						o_left->in_color =
+							INTERVAL_BLACK;
 					tmp->in_color = INTERVAL_RED;
 					__rotate_right(tmp, root);
 					tmp = parent->in_right;
@@ -441,7 +442,8 @@ static void interval_erase_color(struct interval_node *node,
 				tmp->in_color = parent->in_color;
 				parent->in_color = INTERVAL_BLACK;
 				if (tmp->in_right)
-					tmp->in_right->in_color = INTERVAL_BLACK;
+					tmp->in_right->in_color =
+						INTERVAL_BLACK;
 				__rotate_left(parent, root);
 				node = *root;
 				break;
@@ -465,7 +467,8 @@ static void interval_erase_color(struct interval_node *node,
 
 					o_right = tmp->in_right;
 					if (o_right)
-						o_right->in_color = INTERVAL_BLACK;
+						o_right->in_color =
+							INTERVAL_BLACK;
 					tmp->in_color = INTERVAL_RED;
 					__rotate_left(tmp, root);
 					tmp = parent->in_left;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index a4c252f..6541c9d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -622,7 +622,8 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
 		return 0;
 	}
 
-	LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, sleeping");
+	LDLM_DEBUG(lock,
+			"client-side enqueue returned a blocked lock, sleeping");
 	fwd.fwd_lock = lock;
 	obd = class_exp2obd(lock->l_conn_export);
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 84b111e..bd8d458 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -2229,13 +2229,16 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 		libcfs_debug_vmsg2(msgdata, fmt, args,
 				   " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
 				   lock,
-				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
+				   lock->l_handle.h_cookie,
+				   atomic_read(&lock->l_refc),
 				   lock->l_readers, lock->l_writers,
 				   ldlm_lockname[lock->l_granted_mode],
 				   ldlm_lockname[lock->l_req_mode],
-				   lock->l_flags, nid, lock->l_remote_handle.cookie,
+				   lock->l_flags, nid,
+				   lock->l_remote_handle.cookie,
 				   exp ? atomic_read(&exp->exp_refcount) : -99,
-				   lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type);
+				   lock->l_pid, lock->l_callback_timeout,
+				   lock->l_lvb_type);
 		va_end(args);
 		return;
 	}
@@ -2243,9 +2246,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 	switch (resource->lr_type) {
 	case LDLM_EXTENT:
 		libcfs_debug_vmsg2(msgdata, fmt, args,
-				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
+				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
+				   DLDLMRES
+				   " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
 				   ldlm_lock_to_ns_name(lock), lock,
-				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
+				   lock->l_handle.h_cookie,
+				   atomic_read(&lock->l_refc),
 				   lock->l_readers, lock->l_writers,
 				   ldlm_lockname[lock->l_granted_mode],
 				   ldlm_lockname[lock->l_req_mode],
@@ -2254,8 +2260,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 				   ldlm_typename[resource->lr_type],
 				   lock->l_policy_data.l_extent.start,
 				   lock->l_policy_data.l_extent.end,
-				   lock->l_req_extent.start, lock->l_req_extent.end,
-				   lock->l_flags, nid, lock->l_remote_handle.cookie,
+				   lock->l_req_extent.start,
+				   lock->l_req_extent.end,
+				   lock->l_flags, nid,
+				   lock->l_remote_handle.cookie,
 				   exp ? atomic_read(&exp->exp_refcount) : -99,
 				   lock->l_pid, lock->l_callback_timeout,
 				   lock->l_lvb_type);
@@ -2263,9 +2271,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 
 	case LDLM_FLOCK:
 		libcfs_debug_vmsg2(msgdata, fmt, args,
-				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
+				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
+				   DLDLMRES
+				   " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
 				   ldlm_lock_to_ns_name(lock), lock,
-				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
+				   lock->l_handle.h_cookie,
+				   atomic_read(&lock->l_refc),
 				   lock->l_readers, lock->l_writers,
 				   ldlm_lockname[lock->l_granted_mode],
 				   ldlm_lockname[lock->l_req_mode],
@@ -2275,14 +2286,17 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 				   lock->l_policy_data.l_flock.pid,
 				   lock->l_policy_data.l_flock.start,
 				   lock->l_policy_data.l_flock.end,
-				   lock->l_flags, nid, lock->l_remote_handle.cookie,
+				   lock->l_flags, nid,
+				   lock->l_remote_handle.cookie,
 				   exp ? atomic_read(&exp->exp_refcount) : -99,
 				   lock->l_pid, lock->l_callback_timeout);
 		break;
 
 	case LDLM_IBITS:
 		libcfs_debug_vmsg2(msgdata, fmt, args,
-				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
+				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
+				   DLDLMRES
+				   " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
 				   ldlm_lock_to_ns_name(lock),
 				   lock, lock->l_handle.h_cookie,
 				   atomic_read(&lock->l_refc),
@@ -2293,7 +2307,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 				   lock->l_policy_data.l_inodebits.bits,
 				   atomic_read(&resource->lr_refcount),
 				   ldlm_typename[resource->lr_type],
-				   lock->l_flags, nid, lock->l_remote_handle.cookie,
+				   lock->l_flags, nid,
+				   lock->l_remote_handle.cookie,
 				   exp ? atomic_read(&exp->exp_refcount) : -99,
 				   lock->l_pid, lock->l_callback_timeout,
 				   lock->l_lvb_type);
@@ -2301,7 +2316,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 
 	default:
 		libcfs_debug_vmsg2(msgdata, fmt, args,
-				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
+				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
+				   DLDLMRES
+				   " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
 				   ldlm_lock_to_ns_name(lock),
 				   lock, lock->l_handle.h_cookie,
 				   atomic_read(&lock->l_refc),
@@ -2311,7 +2328,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 				   PLDLMRES(resource),
 				   atomic_read(&resource->lr_refcount),
 				   ldlm_typename[resource->lr_type],
-				   lock->l_flags, nid, lock->l_remote_handle.cookie,
+				   lock->l_flags,
+				   nid, lock->l_remote_handle.cookie,
 				   exp ? atomic_read(&exp->exp_refcount) : -99,
 				   lock->l_pid, lock->l_callback_timeout,
 				   lock->l_lvb_type);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index e0a8157..cd15445 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -202,7 +202,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
 
 	lvb_len = req_capsule_get_size(&req->rq_pill, &RMF_DLM_LVB, RCL_CLIENT);
 	if (lvb_len < 0) {
-		LDLM_ERROR(lock, "Fail to get lvb_len, rc = %d", lvb_len);
+		LDLM_ERROR(lock,
+				"Fail to get lvb_len, rc = %d", lvb_len);
 		rc = lvb_len;
 		goto out;
 	} else if (lvb_len > 0) {
@@ -211,7 +212,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
 			LASSERT(lock->l_lvb_data != NULL);
 
 			if (unlikely(lock->l_lvb_len < lvb_len)) {
-				LDLM_ERROR(lock, "Replied LVB is larger than expectation, expected = %d, replied = %d",
+				LDLM_ERROR(lock,
+						"Replied LVB is larger than expectation, expected = %d, replied = %d",
 					   lock->l_lvb_len, lvb_len);
 				rc = -EINVAL;
 				goto out;
@@ -638,7 +640,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
 
 	lock = ldlm_handle2lock_long(&dlm_req->lock_handle[0], 0);
 	if (!lock) {
-		CDEBUG(D_DLMTRACE, "callback on lock %#llx - lock disappeared\n",
+		CDEBUG(D_DLMTRACE,
+				"callback on lock %#llx - lock disappeared\n",
 		       dlm_req->lock_handle[0].cookie);
 		rc = ldlm_callback_reply(req, -EINVAL);
 		ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
@@ -662,7 +665,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
 		if (((lock->l_flags & LDLM_FL_CANCELING) &&
 		    (lock->l_flags & LDLM_FL_BL_DONE)) ||
 		    (lock->l_flags & LDLM_FL_FAILED)) {
-			LDLM_DEBUG(lock, "callback on lock %#llx - lock disappeared\n",
+			LDLM_DEBUG(lock,
+					"callback on lock %#llx - lock disappeared\n",
 				   dlm_req->lock_handle[0].cookie);
 			unlock_res_and_lock(lock);
 			LDLM_LOCK_RELEASE(lock);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index d20d277..3af2687 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -605,10 +605,10 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
 			      pl->pl_recalc_period;
 	if (recalc_interval_sec <= 0) {
 		/* Prevent too frequent recalculation. */
-		CDEBUG(D_DLMTRACE, "Negative interval(%ld), "
-		       "too short period(%ld)",
-		       recalc_interval_sec,
-		       pl->pl_recalc_period);
+		CDEBUG(D_DLMTRACE,
+			"Negative interval(%ld), too short period(%ld)",
+			recalc_interval_sec,
+			pl->pl_recalc_period);
 		recalc_interval_sec = 1;
 	}
 
@@ -634,7 +634,8 @@ int ldlm_pool_shrink(struct ldlm_pool *pl, int nr,
 			lprocfs_counter_add(pl->pl_stats,
 					    LDLM_POOL_SHRINK_FREED_STAT,
 					    cancel);
-			CDEBUG(D_DLMTRACE, "%s: request to shrink %d locks, shrunk %d\n",
+			CDEBUG(D_DLMTRACE,
+					"%s: request to shrink %d locks, shrunk %d\n",
 			       pl->pl_name, nr, cancel);
 		}
 	}
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index c6f62a9..898f896 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -193,7 +193,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file,
 					const char __user *buffer,
 					size_t count, loff_t *off)
 {
-	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
+	struct ldlm_namespace *ns =
+		((struct seq_file *)file->private_data)->private;
 	char dummy[MAX_STRING_SIZE + 1];
 	unsigned long tmp;
 	int lru_resize;
@@ -291,7 +292,8 @@ static ssize_t lprocfs_elc_seq_write(struct file *file,
 				const char __user *buffer,
 				size_t count, loff_t *off)
 {
-	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
+	struct ldlm_namespace *ns =
+		((struct seq_file *)file->private_data)->private;
 	unsigned int supp = -1;
 	int rc;
 
@@ -738,7 +740,8 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
 		} else {
 			ldlm_resource_unlink_lock(lock);
 			unlock_res(res);
-			LDLM_DEBUG(lock, "Freeing a lock still held by a client node");
+			LDLM_DEBUG(lock,
+					"Freeing a lock still held by a client node");
 			ldlm_lock_destroy(lock);
 		}
 		LDLM_LOCK_RELEASE(lock);
@@ -1406,7 +1409,8 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res)
 			LDLM_DEBUG_LIMIT(level, lock, "###");
 			if (!(level & D_CANTMASK) &&
 			    ++granted > ldlm_dump_granted_max) {
-				CDEBUG(level, "only dump %d granted locks to avoid DDOS.\n",
+				CDEBUG(level,
+					"only dump %d granted locks to avoid DDOS.\n",
 				       granted);
 				break;
 			}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] Staging: lustre: lustre: idlm: Move trailing statement to next line
  2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
  2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
@ 2015-02-28 19:20 ` Haneen Mohammed
  2015-02-28 19:21 ` [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c Haneen Mohammed
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:20 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patch Fix both "trailing statement should be on next line"
and space before semicolon errors addressed by checkpatch.pl

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index a89eeba..fd9b059 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -151,7 +151,8 @@ static inline int lock_mode_to_index(ldlm_mode_t mode)
 
 	LASSERT(mode != 0);
 	LASSERT(IS_PO2(mode));
-	for (index = -1; mode; index++, mode >>= 1) ;
+	for (index = -1; mode; index++)
+		mode >>= 1;
 	LASSERT(index < LCK_MODE_NUM);
 	return index;
 }
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c
  2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
  2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
  2015-02-28 19:20 ` [PATCH 2/5] Staging: lustre: lustre: idlm: Move trailing statement to next line Haneen Mohammed
@ 2015-02-28 19:21 ` Haneen Mohammed
  2015-03-02  0:43   ` [Outreachy kernel] " Greg KH
  2015-02-28 19:23 ` [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return Haneen Mohammed
  2015-02-28 19:33 ` [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string Haneen Mohammed
  4 siblings, 1 reply; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:21 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patch moves extern declaration to ldlm_internal.h.
Remove prototype from ldlm_pool.c.
Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 5bf9488..a694f01 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -208,6 +208,8 @@ struct ldlm_state {
 	struct ldlm_bl_pool *ldlm_bl_pool;
 };
 
+/* l_lock.c */
+extern struct proc_dir_entry *ldlm_ns_proc_dir;
 /* interval tree, for LDLM_EXTENT. */
 extern struct kmem_cache *ldlm_interval_slab; /* slab cache for ldlm_interval */
 extern void ldlm_interval_attach(struct ldlm_interval *n, struct ldlm_lock *l);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 3af2687..54e2478 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -141,8 +141,6 @@
  */
 #define LDLM_POOL_SLV_SHIFT (10)
 
-extern struct proc_dir_entry *ldlm_ns_proc_dir;
-
 static inline __u64 dru(__u64 val, __u32 shift, int round_up)
 {
 	return (val + (round_up ? (1 << shift) - 1 : 0)) >> shift;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return
  2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
                   ` (2 preceding siblings ...)
  2015-02-28 19:21 ` [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c Haneen Mohammed
@ 2015-02-28 19:23 ` Haneen Mohammed
  2015-03-02  0:45   ` [Outreachy kernel] " Greg KH
  2015-02-28 19:33 ` [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string Haneen Mohammed
  4 siblings, 1 reply; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:23 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patch fix else is not usefull after break or return.
Issue addressed by checkpatch.pl

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c   |  4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c  | 10 +++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 17 ++++++++---------
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c  |  3 +--
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index c5c86e7..7bcae30 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -668,10 +668,10 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id)
 		DEBUG_REQ(D_NET, req, "processing error (%d)", rc);
 		req->rq_status = rc;
 		return ptlrpc_send_error(req, 1);
-	} else {
-		DEBUG_REQ(D_NET, req, "sending reply");
 	}
 
+	DEBUG_REQ(D_NET, req, "sending reply");
+
 	return ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT);
 }
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index bd8d458..28f2639 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -932,7 +932,8 @@ static void search_granted_lock(struct list_head *queue,
 			prev->mode_link = &mode_end->l_sl_mode;
 			prev->policy_link = &req->l_sl_policy;
 			return;
-		} else if (lock->l_resource->lr_type == LDLM_IBITS) {
+		}
+		if (lock->l_resource->lr_type == LDLM_IBITS) {
 			for (;;) {
 				policy_end =
 					list_entry(lock->l_sl_policy.prev,
@@ -968,11 +969,10 @@ static void search_granted_lock(struct list_head *queue,
 			prev->mode_link = &mode_end->l_sl_mode;
 			prev->policy_link = &req->l_sl_policy;
 			return;
-		} else {
-			LDLM_ERROR(lock,
-				   "is not LDLM_PLAIN or LDLM_IBITS lock");
-			LBUG();
 		}
+		LDLM_ERROR(lock,
+				"is not LDLM_PLAIN or LDLM_IBITS lock");
+		LBUG();
 	}
 
 	/* insert point is last lock on the queue,
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index cd15445..4abca14 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -456,16 +456,15 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
 		init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags);
 
 		return __ldlm_bl_to_thread(blwi, cancel_flags);
-	} else {
-		/* if it is synchronous call do minimum mem alloc, as it could
-		 * be triggered from kernel shrinker
-		 */
-		struct ldlm_bl_work_item blwi;
-
-		memset(&blwi, 0, sizeof(blwi));
-		init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
-		return __ldlm_bl_to_thread(&blwi, cancel_flags);
 	}
+	/* if it is synchronous call do minimum mem alloc, as it could
+	* be triggered from kernel shrinker
+	*/
+	struct ldlm_bl_work_item blwi;
+
+	memset(&blwi, 0, sizeof(blwi));
+	init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
+	return __ldlm_bl_to_thread(&blwi, cancel_flags);
 }
 
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 54e2478..bfdb2b3 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -1363,8 +1363,7 @@ static int ldlm_pools_thread_main(void *arg)
 
 		if (thread_test_and_clear_flags(thread, SVC_STOPPING))
 			break;
-		else
-			thread_test_and_clear_flags(thread, SVC_EVENT);
+		thread_test_and_clear_flags(thread, SVC_EVENT);
 	}
 
 	thread_set_flags(thread, SVC_STOPPED);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string
  2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
                   ` (3 preceding siblings ...)
  2015-02-28 19:23 ` [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return Haneen Mohammed
@ 2015-02-28 19:33 ` Haneen Mohammed
  2015-02-28 19:56   ` [Outreachy kernel] " Julia Lawall
  4 siblings, 1 reply; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 19:33 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patch concatenate two consecutive strings into one, addressing checkpatch.pl warning:
 "Consecutive strings are generally better as a single string"

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index bfdb2b3..0d65d80 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -688,8 +688,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
 			      "  GP:  %d\n",
 			      grant_step, grant_plan);
 	}
-	seq_printf(m, "  GR:  %d\n" "  CR:  %d\n" "  GS:  %d\n"
-		      "  G:   %d\n" "  L:   %d\n",
+	seq_printf(m, "  GR:  %d\n  CR:  %d\n  GS:  %d\n"
+		      "  G:   %d\n  L:   %d\n",
 		      grant_rate, cancel_rate, grant_speed,
 		      granted, limit);
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string
  2015-02-28 19:33 ` [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string Haneen Mohammed
@ 2015-02-28 19:56   ` Julia Lawall
  2015-02-28 20:01     ` Haneen Mohammed
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2015-02-28 19:56 UTC (permalink / raw)
  To: Haneen Mohammed; +Cc: outreachy-kernel

On Sat, 28 Feb 2015, Haneen Mohammed wrote:

> This patch concatenate two consecutive strings into one, addressing checkpatch.pl warning:
>  "Consecutive strings are generally better as a single string"
>
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> index bfdb2b3..0d65d80 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> @@ -688,8 +688,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
>  			      "  GP:  %d\n",
>  			      grant_step, grant_plan);
>  	}
> -	seq_printf(m, "  GR:  %d\n" "  CR:  %d\n" "  GS:  %d\n"
> -		      "  G:   %d\n" "  L:   %d\n",
> +	seq_printf(m, "  GR:  %d\n  CR:  %d\n  GS:  %d\n"
> +		      "  G:   %d\n  L:   %d\n",

The two lines are consecutive strings also.  Checkpatch should have given
you a warning on your result.

julia

>  		      grant_rate, cancel_rate, grant_speed,
>  		      granted, limit);
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425152027-31192-1-git-send-email-hamohammed.sa%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters
  2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
@ 2015-02-28 20:01   ` Julia Lawall
  2015-02-28 21:58     ` Haneen Mohammed
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2015-02-28 20:01 UTC (permalink / raw)
  To: Haneen Mohammed; +Cc: outreachy-kernel

> -	LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, sleeping");
> +	LDLM_DEBUG(lock,
> +			"client-side enqueue returned a blocked lock, sleeping");

This doesn't look very nice.  You could line the string up with the left
side of lock.

julia


>  	fwd.fwd_lock = lock;
>  	obd = class_exp2obd(lock->l_conn_export);
>
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> index 84b111e..bd8d458 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> @@ -2229,13 +2229,16 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  		libcfs_debug_vmsg2(msgdata, fmt, args,
>  				   " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
>  				   lock,
> -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> +				   lock->l_handle.h_cookie,
> +				   atomic_read(&lock->l_refc),
>  				   lock->l_readers, lock->l_writers,
>  				   ldlm_lockname[lock->l_granted_mode],
>  				   ldlm_lockname[lock->l_req_mode],
> -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> +				   lock->l_flags, nid,
> +				   lock->l_remote_handle.cookie,
>  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> -				   lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type);
> +				   lock->l_pid, lock->l_callback_timeout,
> +				   lock->l_lvb_type);
>  		va_end(args);
>  		return;
>  	}
> @@ -2243,9 +2246,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  	switch (resource->lr_type) {
>  	case LDLM_EXTENT:
>  		libcfs_debug_vmsg2(msgdata, fmt, args,
> -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> +				   DLDLMRES
> +				   " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
>  				   ldlm_lock_to_ns_name(lock), lock,
> -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> +				   lock->l_handle.h_cookie,
> +				   atomic_read(&lock->l_refc),
>  				   lock->l_readers, lock->l_writers,
>  				   ldlm_lockname[lock->l_granted_mode],
>  				   ldlm_lockname[lock->l_req_mode],
> @@ -2254,8 +2260,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  				   ldlm_typename[resource->lr_type],
>  				   lock->l_policy_data.l_extent.start,
>  				   lock->l_policy_data.l_extent.end,
> -				   lock->l_req_extent.start, lock->l_req_extent.end,
> -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> +				   lock->l_req_extent.start,
> +				   lock->l_req_extent.end,
> +				   lock->l_flags, nid,
> +				   lock->l_remote_handle.cookie,
>  				   exp ? atomic_read(&exp->exp_refcount) : -99,
>  				   lock->l_pid, lock->l_callback_timeout,
>  				   lock->l_lvb_type);
> @@ -2263,9 +2271,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>
>  	case LDLM_FLOCK:
>  		libcfs_debug_vmsg2(msgdata, fmt, args,
> -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
> +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> +				   DLDLMRES
> +				   " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
>  				   ldlm_lock_to_ns_name(lock), lock,
> -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> +				   lock->l_handle.h_cookie,
> +				   atomic_read(&lock->l_refc),
>  				   lock->l_readers, lock->l_writers,
>  				   ldlm_lockname[lock->l_granted_mode],
>  				   ldlm_lockname[lock->l_req_mode],
> @@ -2275,14 +2286,17 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  				   lock->l_policy_data.l_flock.pid,
>  				   lock->l_policy_data.l_flock.start,
>  				   lock->l_policy_data.l_flock.end,
> -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> +				   lock->l_flags, nid,
> +				   lock->l_remote_handle.cookie,
>  				   exp ? atomic_read(&exp->exp_refcount) : -99,
>  				   lock->l_pid, lock->l_callback_timeout);
>  		break;
>
>  	case LDLM_IBITS:
>  		libcfs_debug_vmsg2(msgdata, fmt, args,
> -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> +				   DLDLMRES
> +				   " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
>  				   ldlm_lock_to_ns_name(lock),
>  				   lock, lock->l_handle.h_cookie,
>  				   atomic_read(&lock->l_refc),
> @@ -2293,7 +2307,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  				   lock->l_policy_data.l_inodebits.bits,
>  				   atomic_read(&resource->lr_refcount),
>  				   ldlm_typename[resource->lr_type],
> -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> +				   lock->l_flags, nid,
> +				   lock->l_remote_handle.cookie,
>  				   exp ? atomic_read(&exp->exp_refcount) : -99,
>  				   lock->l_pid, lock->l_callback_timeout,
>  				   lock->l_lvb_type);
> @@ -2301,7 +2316,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>
>  	default:
>  		libcfs_debug_vmsg2(msgdata, fmt, args,
> -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> +				   DLDLMRES
> +				   " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
>  				   ldlm_lock_to_ns_name(lock),
>  				   lock, lock->l_handle.h_cookie,
>  				   atomic_read(&lock->l_refc),
> @@ -2311,7 +2328,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
>  				   PLDLMRES(resource),
>  				   atomic_read(&resource->lr_refcount),
>  				   ldlm_typename[resource->lr_type],
> -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> +				   lock->l_flags,
> +				   nid, lock->l_remote_handle.cookie,
>  				   exp ? atomic_read(&exp->exp_refcount) : -99,
>  				   lock->l_pid, lock->l_callback_timeout,
>  				   lock->l_lvb_type);
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> index e0a8157..cd15445 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> @@ -202,7 +202,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
>
>  	lvb_len = req_capsule_get_size(&req->rq_pill, &RMF_DLM_LVB, RCL_CLIENT);
>  	if (lvb_len < 0) {
> -		LDLM_ERROR(lock, "Fail to get lvb_len, rc = %d", lvb_len);
> +		LDLM_ERROR(lock,
> +				"Fail to get lvb_len, rc = %d", lvb_len);
>  		rc = lvb_len;
>  		goto out;
>  	} else if (lvb_len > 0) {
> @@ -211,7 +212,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
>  			LASSERT(lock->l_lvb_data != NULL);
>
>  			if (unlikely(lock->l_lvb_len < lvb_len)) {
> -				LDLM_ERROR(lock, "Replied LVB is larger than expectation, expected = %d, replied = %d",
> +				LDLM_ERROR(lock,
> +						"Replied LVB is larger than expectation, expected = %d, replied = %d",
>  					   lock->l_lvb_len, lvb_len);
>  				rc = -EINVAL;
>  				goto out;
> @@ -638,7 +640,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
>
>  	lock = ldlm_handle2lock_long(&dlm_req->lock_handle[0], 0);
>  	if (!lock) {
> -		CDEBUG(D_DLMTRACE, "callback on lock %#llx - lock disappeared\n",
> +		CDEBUG(D_DLMTRACE,
> +				"callback on lock %#llx - lock disappeared\n",
>  		       dlm_req->lock_handle[0].cookie);
>  		rc = ldlm_callback_reply(req, -EINVAL);
>  		ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
> @@ -662,7 +665,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
>  		if (((lock->l_flags & LDLM_FL_CANCELING) &&
>  		    (lock->l_flags & LDLM_FL_BL_DONE)) ||
>  		    (lock->l_flags & LDLM_FL_FAILED)) {
> -			LDLM_DEBUG(lock, "callback on lock %#llx - lock disappeared\n",
> +			LDLM_DEBUG(lock,
> +					"callback on lock %#llx - lock disappeared\n",
>  				   dlm_req->lock_handle[0].cookie);
>  			unlock_res_and_lock(lock);
>  			LDLM_LOCK_RELEASE(lock);
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> index d20d277..3af2687 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> @@ -605,10 +605,10 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
>  			      pl->pl_recalc_period;
>  	if (recalc_interval_sec <= 0) {
>  		/* Prevent too frequent recalculation. */
> -		CDEBUG(D_DLMTRACE, "Negative interval(%ld), "
> -		       "too short period(%ld)",
> -		       recalc_interval_sec,
> -		       pl->pl_recalc_period);
> +		CDEBUG(D_DLMTRACE,
> +			"Negative interval(%ld), too short period(%ld)",
> +			recalc_interval_sec,
> +			pl->pl_recalc_period);
>  		recalc_interval_sec = 1;
>  	}
>
> @@ -634,7 +634,8 @@ int ldlm_pool_shrink(struct ldlm_pool *pl, int nr,
>  			lprocfs_counter_add(pl->pl_stats,
>  					    LDLM_POOL_SHRINK_FREED_STAT,
>  					    cancel);
> -			CDEBUG(D_DLMTRACE, "%s: request to shrink %d locks, shrunk %d\n",
> +			CDEBUG(D_DLMTRACE,
> +					"%s: request to shrink %d locks, shrunk %d\n",
>  			       pl->pl_name, nr, cancel);
>  		}
>  	}
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> index c6f62a9..898f896 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> @@ -193,7 +193,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file,
>  					const char __user *buffer,
>  					size_t count, loff_t *off)
>  {
> -	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
> +	struct ldlm_namespace *ns =
> +		((struct seq_file *)file->private_data)->private;
>  	char dummy[MAX_STRING_SIZE + 1];
>  	unsigned long tmp;
>  	int lru_resize;
> @@ -291,7 +292,8 @@ static ssize_t lprocfs_elc_seq_write(struct file *file,
>  				const char __user *buffer,
>  				size_t count, loff_t *off)
>  {
> -	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
> +	struct ldlm_namespace *ns =
> +		((struct seq_file *)file->private_data)->private;
>  	unsigned int supp = -1;
>  	int rc;
>
> @@ -738,7 +740,8 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
>  		} else {
>  			ldlm_resource_unlink_lock(lock);
>  			unlock_res(res);
> -			LDLM_DEBUG(lock, "Freeing a lock still held by a client node");
> +			LDLM_DEBUG(lock,
> +					"Freeing a lock still held by a client node");
>  			ldlm_lock_destroy(lock);
>  		}
>  		LDLM_LOCK_RELEASE(lock);
> @@ -1406,7 +1409,8 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res)
>  			LDLM_DEBUG_LIMIT(level, lock, "###");
>  			if (!(level & D_CANTMASK) &&
>  			    ++granted > ldlm_dump_granted_max) {
> -				CDEBUG(level, "only dump %d granted locks to avoid DDOS.\n",
> +				CDEBUG(level,
> +					"only dump %d granted locks to avoid DDOS.\n",
>  				       granted);
>  				break;
>  			}
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425151043-30881-1-git-send-email-hamohammed.sa%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string
  2015-02-28 19:56   ` [Outreachy kernel] " Julia Lawall
@ 2015-02-28 20:01     ` Haneen Mohammed
  2015-02-28 20:03       ` Julia Lawall
  0 siblings, 1 reply; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 20:01 UTC (permalink / raw)
  To: Julia Lawall, outreachy-kernel

On Sat, Feb 28, 2015 at 02:56:10PM -0500, Julia Lawall wrote:
> On Sat, 28 Feb 2015, Haneen Mohammed wrote:
> 
> > This patch concatenate two consecutive strings into one, addressing checkpatch.pl warning:
> >  "Consecutive strings are generally better as a single string"
> >
> > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> > ---
> >  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > index bfdb2b3..0d65d80 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > @@ -688,8 +688,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
> >  			      "  GP:  %d\n",
> >  			      grant_step, grant_plan);
> >  	}
> > -	seq_printf(m, "  GR:  %d\n" "  CR:  %d\n" "  GS:  %d\n"
> > -		      "  G:   %d\n" "  L:   %d\n",
> > +	seq_printf(m, "  GR:  %d\n  CR:  %d\n  GS:  %d\n"
> > +		      "  G:   %d\n  L:   %d\n",
> 
> The two lines are consecutive strings also.  Checkpatch should have given
> you a warning on your result.
> 
> julia
> 

Strangely it didn't so I thought that was special case. Should I
combine them all into one?

Thanks,
Haneen
> >  		      grant_rate, cancel_rate, grant_speed,
> >  		      granted, limit);
> >
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425152027-31192-1-git-send-email-hamohammed.sa%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string
  2015-02-28 20:01     ` Haneen Mohammed
@ 2015-02-28 20:03       ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2015-02-28 20:03 UTC (permalink / raw)
  To: Haneen Mohammed; +Cc: outreachy-kernel

On Sat, 28 Feb 2015, Haneen Mohammed wrote:

> On Sat, Feb 28, 2015 at 02:56:10PM -0500, Julia Lawall wrote:
> > On Sat, 28 Feb 2015, Haneen Mohammed wrote:
> >
> > > This patch concatenate two consecutive strings into one, addressing checkpatch.pl warning:
> > >  "Consecutive strings are generally better as a single string"
> > >
> > > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> > > ---
> > >  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > > index bfdb2b3..0d65d80 100644
> > > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > > @@ -688,8 +688,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
> > >  			      "  GP:  %d\n",
> > >  			      grant_step, grant_plan);
> > >  	}
> > > -	seq_printf(m, "  GR:  %d\n" "  CR:  %d\n" "  GS:  %d\n"
> > > -		      "  G:   %d\n" "  L:   %d\n",
> > > +	seq_printf(m, "  GR:  %d\n  CR:  %d\n  GS:  %d\n"
> > > +		      "  G:   %d\n  L:   %d\n",
> >
> > The two lines are consecutive strings also.  Checkpatch should have given
> > you a warning on your result.
> >
> > julia
> >
>
> Strangely it didn't so I thought that was special case. Should I
> combine them all into one?

OK, maybe it doesn't because of the \n?  The idea of combining the strings
is so that one can grep for what one sees on a line.  But with the \n's
that is already the case.  So maybe it is OK as is.

julia


>
> Thanks,
> Haneen
> > >  		      grant_rate, cancel_rate, grant_speed,
> > >  		      granted, limit);
> > >
> > > --
> > > 1.9.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425152027-31192-1-git-send-email-hamohammed.sa%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150228200158.GA12813%40example.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters
  2015-02-28 20:01   ` [Outreachy kernel] " Julia Lawall
@ 2015-02-28 21:58     ` Haneen Mohammed
  0 siblings, 0 replies; 13+ messages in thread
From: Haneen Mohammed @ 2015-02-28 21:58 UTC (permalink / raw)
  To: Julia Lawall, outreachy-kernel

On Sat, Feb 28, 2015 at 03:01:16PM -0500, Julia Lawall wrote:
> > -	LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, sleeping");
> > +	LDLM_DEBUG(lock,
> > +			"client-side enqueue returned a blocked lock, sleeping");
> 
> This doesn't look very nice.  You could line the string up with the left
> side of lock.
> 
> julia
> 
> 

I don't know why, but this is lined right with lock in my editor.
why does it change when I send it out?

Thanks,
Haneen
> >  	fwd.fwd_lock = lock;
> >  	obd = class_exp2obd(lock->l_conn_export);
> >
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> > index 84b111e..bd8d458 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> > @@ -2229,13 +2229,16 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  		libcfs_debug_vmsg2(msgdata, fmt, args,
> >  				   " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> >  				   lock,
> > -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> > +				   lock->l_handle.h_cookie,
> > +				   atomic_read(&lock->l_refc),
> >  				   lock->l_readers, lock->l_writers,
> >  				   ldlm_lockname[lock->l_granted_mode],
> >  				   ldlm_lockname[lock->l_req_mode],
> > -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> > +				   lock->l_flags, nid,
> > +				   lock->l_remote_handle.cookie,
> >  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> > -				   lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type);
> > +				   lock->l_pid, lock->l_callback_timeout,
> > +				   lock->l_lvb_type);
> >  		va_end(args);
> >  		return;
> >  	}
> > @@ -2243,9 +2246,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  	switch (resource->lr_type) {
> >  	case LDLM_EXTENT:
> >  		libcfs_debug_vmsg2(msgdata, fmt, args,
> > -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> > +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> > +				   DLDLMRES
> > +				   " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> >  				   ldlm_lock_to_ns_name(lock), lock,
> > -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> > +				   lock->l_handle.h_cookie,
> > +				   atomic_read(&lock->l_refc),
> >  				   lock->l_readers, lock->l_writers,
> >  				   ldlm_lockname[lock->l_granted_mode],
> >  				   ldlm_lockname[lock->l_req_mode],
> > @@ -2254,8 +2260,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  				   ldlm_typename[resource->lr_type],
> >  				   lock->l_policy_data.l_extent.start,
> >  				   lock->l_policy_data.l_extent.end,
> > -				   lock->l_req_extent.start, lock->l_req_extent.end,
> > -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> > +				   lock->l_req_extent.start,
> > +				   lock->l_req_extent.end,
> > +				   lock->l_flags, nid,
> > +				   lock->l_remote_handle.cookie,
> >  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> >  				   lock->l_pid, lock->l_callback_timeout,
> >  				   lock->l_lvb_type);
> > @@ -2263,9 +2271,12 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >
> >  	case LDLM_FLOCK:
> >  		libcfs_debug_vmsg2(msgdata, fmt, args,
> > -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
> > +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> > +				   DLDLMRES
> > +				   " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n",
> >  				   ldlm_lock_to_ns_name(lock), lock,
> > -				   lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
> > +				   lock->l_handle.h_cookie,
> > +				   atomic_read(&lock->l_refc),
> >  				   lock->l_readers, lock->l_writers,
> >  				   ldlm_lockname[lock->l_granted_mode],
> >  				   ldlm_lockname[lock->l_req_mode],
> > @@ -2275,14 +2286,17 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  				   lock->l_policy_data.l_flock.pid,
> >  				   lock->l_policy_data.l_flock.start,
> >  				   lock->l_policy_data.l_flock.end,
> > -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> > +				   lock->l_flags, nid,
> > +				   lock->l_remote_handle.cookie,
> >  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> >  				   lock->l_pid, lock->l_callback_timeout);
> >  		break;
> >
> >  	case LDLM_IBITS:
> >  		libcfs_debug_vmsg2(msgdata, fmt, args,
> > -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> > +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> > +				   DLDLMRES
> > +				   " bits %#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> >  				   ldlm_lock_to_ns_name(lock),
> >  				   lock, lock->l_handle.h_cookie,
> >  				   atomic_read(&lock->l_refc),
> > @@ -2293,7 +2307,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  				   lock->l_policy_data.l_inodebits.bits,
> >  				   atomic_read(&resource->lr_refcount),
> >  				   ldlm_typename[resource->lr_type],
> > -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> > +				   lock->l_flags, nid,
> > +				   lock->l_remote_handle.cookie,
> >  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> >  				   lock->l_pid, lock->l_callback_timeout,
> >  				   lock->l_lvb_type);
> > @@ -2301,7 +2316,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >
> >  	default:
> >  		libcfs_debug_vmsg2(msgdata, fmt, args,
> > -				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> > +				   " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: "
> > +				   DLDLMRES
> > +				   " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
> >  				   ldlm_lock_to_ns_name(lock),
> >  				   lock, lock->l_handle.h_cookie,
> >  				   atomic_read(&lock->l_refc),
> > @@ -2311,7 +2328,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
> >  				   PLDLMRES(resource),
> >  				   atomic_read(&resource->lr_refcount),
> >  				   ldlm_typename[resource->lr_type],
> > -				   lock->l_flags, nid, lock->l_remote_handle.cookie,
> > +				   lock->l_flags,
> > +				   nid, lock->l_remote_handle.cookie,
> >  				   exp ? atomic_read(&exp->exp_refcount) : -99,
> >  				   lock->l_pid, lock->l_callback_timeout,
> >  				   lock->l_lvb_type);
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> > index e0a8157..cd15445 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> > @@ -202,7 +202,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
> >
> >  	lvb_len = req_capsule_get_size(&req->rq_pill, &RMF_DLM_LVB, RCL_CLIENT);
> >  	if (lvb_len < 0) {
> > -		LDLM_ERROR(lock, "Fail to get lvb_len, rc = %d", lvb_len);
> > +		LDLM_ERROR(lock,
> > +				"Fail to get lvb_len, rc = %d", lvb_len);
> >  		rc = lvb_len;
> >  		goto out;
> >  	} else if (lvb_len > 0) {
> > @@ -211,7 +212,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
> >  			LASSERT(lock->l_lvb_data != NULL);
> >
> >  			if (unlikely(lock->l_lvb_len < lvb_len)) {
> > -				LDLM_ERROR(lock, "Replied LVB is larger than expectation, expected = %d, replied = %d",
> > +				LDLM_ERROR(lock,
> > +						"Replied LVB is larger than expectation, expected = %d, replied = %d",
> >  					   lock->l_lvb_len, lvb_len);
> >  				rc = -EINVAL;
> >  				goto out;
> > @@ -638,7 +640,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
> >
> >  	lock = ldlm_handle2lock_long(&dlm_req->lock_handle[0], 0);
> >  	if (!lock) {
> > -		CDEBUG(D_DLMTRACE, "callback on lock %#llx - lock disappeared\n",
> > +		CDEBUG(D_DLMTRACE,
> > +				"callback on lock %#llx - lock disappeared\n",
> >  		       dlm_req->lock_handle[0].cookie);
> >  		rc = ldlm_callback_reply(req, -EINVAL);
> >  		ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
> > @@ -662,7 +665,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
> >  		if (((lock->l_flags & LDLM_FL_CANCELING) &&
> >  		    (lock->l_flags & LDLM_FL_BL_DONE)) ||
> >  		    (lock->l_flags & LDLM_FL_FAILED)) {
> > -			LDLM_DEBUG(lock, "callback on lock %#llx - lock disappeared\n",
> > +			LDLM_DEBUG(lock,
> > +					"callback on lock %#llx - lock disappeared\n",
> >  				   dlm_req->lock_handle[0].cookie);
> >  			unlock_res_and_lock(lock);
> >  			LDLM_LOCK_RELEASE(lock);
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > index d20d277..3af2687 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> > @@ -605,10 +605,10 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
> >  			      pl->pl_recalc_period;
> >  	if (recalc_interval_sec <= 0) {
> >  		/* Prevent too frequent recalculation. */
> > -		CDEBUG(D_DLMTRACE, "Negative interval(%ld), "
> > -		       "too short period(%ld)",
> > -		       recalc_interval_sec,
> > -		       pl->pl_recalc_period);
> > +		CDEBUG(D_DLMTRACE,
> > +			"Negative interval(%ld), too short period(%ld)",
> > +			recalc_interval_sec,
> > +			pl->pl_recalc_period);
> >  		recalc_interval_sec = 1;
> >  	}
> >
> > @@ -634,7 +634,8 @@ int ldlm_pool_shrink(struct ldlm_pool *pl, int nr,
> >  			lprocfs_counter_add(pl->pl_stats,
> >  					    LDLM_POOL_SHRINK_FREED_STAT,
> >  					    cancel);
> > -			CDEBUG(D_DLMTRACE, "%s: request to shrink %d locks, shrunk %d\n",
> > +			CDEBUG(D_DLMTRACE,
> > +					"%s: request to shrink %d locks, shrunk %d\n",
> >  			       pl->pl_name, nr, cancel);
> >  		}
> >  	}
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> > index c6f62a9..898f896 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> > @@ -193,7 +193,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file,
> >  					const char __user *buffer,
> >  					size_t count, loff_t *off)
> >  {
> > -	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
> > +	struct ldlm_namespace *ns =
> > +		((struct seq_file *)file->private_data)->private;
> >  	char dummy[MAX_STRING_SIZE + 1];
> >  	unsigned long tmp;
> >  	int lru_resize;
> > @@ -291,7 +292,8 @@ static ssize_t lprocfs_elc_seq_write(struct file *file,
> >  				const char __user *buffer,
> >  				size_t count, loff_t *off)
> >  {
> > -	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
> > +	struct ldlm_namespace *ns =
> > +		((struct seq_file *)file->private_data)->private;
> >  	unsigned int supp = -1;
> >  	int rc;
> >
> > @@ -738,7 +740,8 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
> >  		} else {
> >  			ldlm_resource_unlink_lock(lock);
> >  			unlock_res(res);
> > -			LDLM_DEBUG(lock, "Freeing a lock still held by a client node");
> > +			LDLM_DEBUG(lock,
> > +					"Freeing a lock still held by a client node");
> >  			ldlm_lock_destroy(lock);
> >  		}
> >  		LDLM_LOCK_RELEASE(lock);
> > @@ -1406,7 +1409,8 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res)
> >  			LDLM_DEBUG_LIMIT(level, lock, "###");
> >  			if (!(level & D_CANTMASK) &&
> >  			    ++granted > ldlm_dump_granted_max) {
> > -				CDEBUG(level, "only dump %d granted locks to avoid DDOS.\n",
> > +				CDEBUG(level,
> > +					"only dump %d granted locks to avoid DDOS.\n",
> >  				       granted);
> >  				break;
> >  			}
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425151043-30881-1-git-send-email-hamohammed.sa%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c
  2015-02-28 19:21 ` [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c Haneen Mohammed
@ 2015-03-02  0:43   ` Greg KH
  0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2015-03-02  0:43 UTC (permalink / raw)
  To: Haneen Mohammed; +Cc: outreachy-kernel

On Sat, Feb 28, 2015 at 10:21:55PM +0300, Haneen Mohammed wrote:
> This patch moves extern declaration to ldlm_internal.h.
> Remove prototype from ldlm_pool.c.
> Issue addressed by checkpatch.pl.
> 
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 ++
>  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
> index 5bf9488..a694f01 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
> @@ -208,6 +208,8 @@ struct ldlm_state {
>  	struct ldlm_bl_pool *ldlm_bl_pool;
>  };
>  
> +/* l_lock.c */
> +extern struct proc_dir_entry *ldlm_ns_proc_dir;
>  /* interval tree, for LDLM_EXTENT. */
>  extern struct kmem_cache *ldlm_interval_slab; /* slab cache for ldlm_interval */
>  extern void ldlm_interval_attach(struct ldlm_interval *n, struct ldlm_lock *l);
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> index 3af2687..54e2478 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
> @@ -141,8 +141,6 @@
>   */
>  #define LDLM_POOL_SLV_SHIFT (10)
>  
> -extern struct proc_dir_entry *ldlm_ns_proc_dir;
> -

This variable isn't used in this file, so this line can just be removed,
and the variable make static in the file it is created in, don't make it
global.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return
  2015-02-28 19:23 ` [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return Haneen Mohammed
@ 2015-03-02  0:45   ` Greg KH
  0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2015-03-02  0:45 UTC (permalink / raw)
  To: Haneen Mohammed; +Cc: outreachy-kernel

On Sat, Feb 28, 2015 at 10:23:05PM +0300, Haneen Mohammed wrote:
> This patch fix else is not usefull after break or return.
> Issue addressed by checkpatch.pl
> 
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ldlm/ldlm_lib.c   |  4 ++--
>  drivers/staging/lustre/lustre/ldlm/ldlm_lock.c  | 10 +++++-----
>  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 17 ++++++++---------
>  drivers/staging/lustre/lustre/ldlm/ldlm_pool.c  |  3 +--
>  4 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> index c5c86e7..7bcae30 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
> @@ -668,10 +668,10 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id)
>  		DEBUG_REQ(D_NET, req, "processing error (%d)", rc);
>  		req->rq_status = rc;
>  		return ptlrpc_send_error(req, 1);
> -	} else {
> -		DEBUG_REQ(D_NET, req, "sending reply");
>  	}
>  
> +	DEBUG_REQ(D_NET, req, "sending reply");
> +
>  	return ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT);
>  }
>  
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> index bd8d458..28f2639 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> @@ -932,7 +932,8 @@ static void search_granted_lock(struct list_head *queue,
>  			prev->mode_link = &mode_end->l_sl_mode;
>  			prev->policy_link = &req->l_sl_policy;
>  			return;
> -		} else if (lock->l_resource->lr_type == LDLM_IBITS) {
> +		}
> +		if (lock->l_resource->lr_type == LDLM_IBITS) {
>  			for (;;) {
>  				policy_end =
>  					list_entry(lock->l_sl_policy.prev,
> @@ -968,11 +969,10 @@ static void search_granted_lock(struct list_head *queue,
>  			prev->mode_link = &mode_end->l_sl_mode;
>  			prev->policy_link = &req->l_sl_policy;
>  			return;
> -		} else {
> -			LDLM_ERROR(lock,
> -				   "is not LDLM_PLAIN or LDLM_IBITS lock");
> -			LBUG();
>  		}
> +		LDLM_ERROR(lock,
> +				"is not LDLM_PLAIN or LDLM_IBITS lock");
> +		LBUG();
>  	}
>  
>  	/* insert point is last lock on the queue,
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> index cd15445..4abca14 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> @@ -456,16 +456,15 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
>  		init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags);
>  
>  		return __ldlm_bl_to_thread(blwi, cancel_flags);
> -	} else {
> -		/* if it is synchronous call do minimum mem alloc, as it could
> -		 * be triggered from kernel shrinker
> -		 */
> -		struct ldlm_bl_work_item blwi;
> -
> -		memset(&blwi, 0, sizeof(blwi));
> -		init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
> -		return __ldlm_bl_to_thread(&blwi, cancel_flags);
>  	}
> +	/* if it is synchronous call do minimum mem alloc, as it could
> +	* be triggered from kernel shrinker
> +	*/

Formatting of this comment block changed :(



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-03-02  0:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-28 19:11 [PATCH 0/5] Staging: lustre: lustre: ldlm: Fix coding style issues Haneen Mohammed
2015-02-28 19:17 ` [PATCH 1/5] Staging: lustre: lustre: ldlm: Fix line over 80 characters Haneen Mohammed
2015-02-28 20:01   ` [Outreachy kernel] " Julia Lawall
2015-02-28 21:58     ` Haneen Mohammed
2015-02-28 19:20 ` [PATCH 2/5] Staging: lustre: lustre: idlm: Move trailing statement to next line Haneen Mohammed
2015-02-28 19:21 ` [PATCH 3/5] Staging: lustre: lustre: ldlm: Fix externs should be avoided in .c Haneen Mohammed
2015-03-02  0:43   ` [Outreachy kernel] " Greg KH
2015-02-28 19:23 ` [PATCH 4/5] Staging: lustre: lustre: ldlm: Remove unnecessary else after return Haneen Mohammed
2015-03-02  0:45   ` [Outreachy kernel] " Greg KH
2015-02-28 19:33 ` [PATCH 5/5] Staging: lustre: lustre: ldlm: Concatenate strings into single string Haneen Mohammed
2015-02-28 19:56   ` [Outreachy kernel] " Julia Lawall
2015-02-28 20:01     ` Haneen Mohammed
2015-02-28 20:03       ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.