All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 06/11] lustre: mdc: checkpatch cleanup
Date: Sun, 21 Jul 2019 21:52:13 -0400	[thread overview]
Message-ID: <1563760338-806-7-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1563760338-806-1-git-send-email-jsimmons@infradead.org>

Many checkpatch errors exist in the mdc layer. This address
a good chuck of them. Other are left since future patches will
cleanup those areas. Others will need more code rework so this
patch handles the simple cases. This is a good step forward
toward proper kernel code style compliance.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/mdc/mdc_changelog.c | 15 ++++++++++-----
 fs/lustre/mdc/mdc_lib.c       | 15 ++++++++++-----
 fs/lustre/mdc/mdc_locks.c     |  2 +-
 fs/lustre/mdc/mdc_request.c   | 16 ++++++++++------
 4 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/fs/lustre/mdc/mdc_changelog.c b/fs/lustre/mdc/mdc_changelog.c
index 45aef9c..011bcc9 100644
--- a/fs/lustre/mdc/mdc_changelog.c
+++ b/fs/lustre/mdc/mdc_changelog.c
@@ -112,7 +112,8 @@ enum {
  * @hdr:	Header of the current llog record
  * @data:	chlg_reader_state passed from caller
  *
- * Returns:	0 or LLOG_PROC_* control code on success, negated error on failure.
+ * Returns:	0 or LLOG_PROC_* control code on success,
+ *		negated error on failure.
  */
 static int chlg_read_cat_process_cb(const struct lu_env *env,
 				    struct llog_handle *llh,
@@ -276,7 +277,8 @@ static int chlg_load(void *args)
  * @ppos:	File position, updated with the index number of the next
  *		record to read.
  *
- * Returns:	number of copied bytes on success, negated error code on failure.
+ * Returns:	number of copied bytes on success,
+ *		negated error code on failure.
  */
 static ssize_t chlg_read(struct file *file, char __user *buff, size_t count,
 			 loff_t *ppos)
@@ -377,7 +379,8 @@ static int chlg_set_start_offset(struct chlg_reader_state *crs, u64 offset)
  * @off:	Offset to skip, actually a record index, not byte count
  * @whence:	Relative/Absolute interpretation of the offset
  *
- * Returns:	the resulting position on success or negated error code on failure.
+ * Returns:	the resulting position on success or
+ *		negated error code on failure.
  */
 static loff_t chlg_llseek(struct file *file, loff_t off, int whence)
 {
@@ -434,7 +437,8 @@ static int chlg_clear(struct chlg_reader_state *crs, u32 reader, u64 record)
 	else
 		ret = obd_set_info_async(NULL, obd->obd_self_export,
 					 strlen(KEY_CHANGELOG_CLEAR),
-					 KEY_CHANGELOG_CLEAR, sizeof(cs), &cs, NULL);
+					 KEY_CHANGELOG_CLEAR, sizeof(cs),
+					 &cs, NULL);
 	mutex_unlock(&chlg_registered_dev_lock);
 	return ret;
 }
@@ -451,7 +455,8 @@ static int chlg_clear(struct chlg_reader_state *crs, u32 reader, u64 record)
  * @count:	Number of written bytes
  * @off:	(unused)
  *
- * Returns:	number of written bytes on success, negated error code on failure.
+ * Returns:	number of written bytes on success,
+ *		negated error code on failure.
  */
 static ssize_t chlg_write(struct file *file, const char __user *buff,
 			  size_t count, loff_t *off)
diff --git a/fs/lustre/mdc/mdc_lib.c b/fs/lustre/mdc/mdc_lib.c
index 7680346..6aa9dc2 100644
--- a/fs/lustre/mdc/mdc_lib.c
+++ b/fs/lustre/mdc/mdc_lib.c
@@ -157,7 +157,8 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	char *tmp;
 	u64 flags;
 
-	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create));
+	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
+		     sizeof(struct mdt_rec_create));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	rec->cr_opcode = REINT_CREATE;
@@ -225,7 +226,8 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	char *tmp;
 	u64 cr_flags;
 
-	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create));
+	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
+		     sizeof(struct mdt_rec_create));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	/* XXX do something about time, uid, gid */
@@ -380,7 +382,8 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 {
 	struct mdt_rec_unlink *rec;
 
-	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_unlink));
+	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
+		     sizeof(struct mdt_rec_unlink));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	rec->ul_opcode = op_data->op_cli_flags & CLI_RM_ENTRY ?
@@ -403,7 +406,8 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 {
 	struct mdt_rec_link *rec;
 
-	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_link));
+	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
+		     sizeof(struct mdt_rec_link));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	rec->lk_opcode = REINT_LINK;
@@ -451,7 +455,8 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 {
 	struct mdt_rec_rename *rec;
 
-	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_rename));
+	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
+		     sizeof(struct mdt_rec_rename));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	/* XXX do something about time, uid, gid */
diff --git a/fs/lustre/mdc/mdc_locks.c b/fs/lustre/mdc/mdc_locks.c
index 430c422..4e6928e 100644
--- a/fs/lustre/mdc/mdc_locks.c
+++ b/fs/lustre/mdc/mdc_locks.c
@@ -630,7 +630,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 			mdc_set_open_replay_data(NULL, NULL, it);
 		}
 
-		if ((body->mbo_valid & (OBD_MD_FLDIREA | OBD_MD_FLEASIZE)) != 0) {
+		if (body->mbo_valid & (OBD_MD_FLDIREA | OBD_MD_FLEASIZE)) {
 			void *eadata;
 
 			mdc_update_max_ea_from_body(exp, body);
diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c
index 6f933b5..dd90e931 100644
--- a/fs/lustre/mdc/mdc_request.c
+++ b/fs/lustre/mdc/mdc_request.c
@@ -803,8 +803,8 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
 		mod->mod_open_req->rq_replay = 0;
 		spin_unlock(&mod->mod_open_req->rq_lock);
 	} else {
-		 CDEBUG(D_HA,
-			"couldn't find open req; expecting close error\n");
+		CDEBUG(D_HA,
+		       "couldn't find open req; expecting close error\n");
 	}
 	if (!req) {
 		/*
@@ -1019,9 +1019,11 @@ static struct page *mdc_page_locate(struct address_space *mapping, u64 *hash,
 			if (unlikely(*start == 1 && *hash == 0))
 				*hash = *start;
 			else
-				LASSERTF(*start <= *hash, "start = %#llx,end = %#llx,hash = %#llx\n",
+				LASSERTF(*start <= *hash,
+					 "start = %#llx,end = %#llx,hash = %#llx\n",
 					 *start, *end, *hash);
-			CDEBUG(D_VFSTRACE, "offset %lx [%#llx %#llx], hash %#llx\n",
+			CDEBUG(D_VFSTRACE,
+			       "offset %lx [%#llx %#llx], hash %#llx\n",
 			       offset, *start, *end, *hash);
 			if (*hash > *end) {
 				kunmap(page);
@@ -1258,7 +1260,8 @@ static int mdc_read_page_remote(void *data, struct page *page0)
 		if (!ret)
 			unlock_page(page);
 		else
-			CDEBUG(D_VFSTRACE, "page %lu add to page cache failed: rc = %d\n",
+			CDEBUG(D_VFSTRACE,
+			       "page %lu add to page cache failed: rc = %d\n",
 			       offset, ret);
 		put_page(page);
 	}
@@ -1325,7 +1328,8 @@ static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data,
 	page = mdc_page_locate(mapping, &rp_param.rp_off, &start, &end,
 			       rp_param.rp_hash64);
 	if (IS_ERR(page)) {
-		CDEBUG(D_INFO, "%s: dir page locate: " DFID " at %llu: rc %ld\n",
+		CDEBUG(D_INFO,
+		       "%s: dir page locate: " DFID " at %llu: rc %ld\n",
 		       exp->exp_obd->obd_name, PFID(&op_data->op_fid1),
 		       rp_param.rp_off, PTR_ERR(page));
 		rc = PTR_ERR(page);
-- 
1.8.3.1

  parent reply	other threads:[~2019-07-22  1:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  1:52 [lustre-devel] [PATCH 00/11] lustre: cleanup most check patch issues James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 01/11] lustre: ptlrpc: checkpatch cleanup James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 02/11] lustre: llite: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 03/11] lustre: fid: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 04/11] lustre: mgc: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 05/11] lustre: lmv: " James Simmons
2019-07-22  1:52 ` James Simmons [this message]
2019-07-22  1:52 ` [lustre-devel] [PATCH 07/11] lustre: osc: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 08/11] lustre: lov: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 09/11] lustre: obdclass: " James Simmons
2019-07-22  1:52 ` [lustre-devel] [PATCH 10/11] lustre: ldlm: " James Simmons
2019-07-23  2:54   ` NeilBrown
2019-07-24  3:37     ` James Simmons
2019-07-24  7:23       ` Degremont, Aurelien
2019-07-25  1:54         ` James Simmons
2019-07-25  8:07           ` Degremont, Aurelien
2019-07-29 19:40             ` James Simmons
2019-07-30 16:02               ` Degremont, Aurelien
2019-07-22  1:52 ` [lustre-devel] [PATCH 11/11] lustre: internal headers " James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1563760338-806-7-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.