[PATCH 1/5] NOP-In preparatory cleanups

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown [PATCH 1/5] NOP-In preparatory cleanups

by Arne Redlich-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

- s/NOOP/NOP/g
- move implicit "*_NR_<KEY>" from usr/param.c::SET_KEY_VALUES() macro back to
  the key's name. We might want to add keys that don't fit into that naming
  scheme.
---
 kernel/iscsi.c     |   20 ++++++++++----------
 kernel/iscsi_hdr.h |    4 ++--
 usr/iscsi_hdr.h    |    4 ++--
 usr/param.c        |    6 +++---
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/kernel/iscsi.c b/kernel/iscsi.c
index 9143254..6ad5813 100644
--- a/kernel/iscsi.c
+++ b/kernel/iscsi.c
@@ -829,7 +829,7 @@ static void scsi_cmnd_exec(struct iscsi_cmnd *cmnd)
  }
 }
 
-static int noop_out_start(struct iscsi_conn *conn, struct iscsi_cmnd *cmnd)
+static int nop_out_start(struct iscsi_conn *conn, struct iscsi_cmnd *cmnd)
 {
  u32 size, tmp;
  int i, err = 0;
@@ -1312,7 +1312,7 @@ out:
  iscsi_cmnd_init_write(rsp);
 }
 
-static void noop_out_exec(struct iscsi_cmnd *req)
+static void nop_out_exec(struct iscsi_cmnd *req)
 {
  struct iscsi_cmnd *rsp;
  struct iscsi_nop_in_hdr *rsp_hdr;
@@ -1321,7 +1321,7 @@ static void noop_out_exec(struct iscsi_cmnd *req)
  rsp = iscsi_cmnd_create_rsp_cmnd(req, 1);
 
  rsp_hdr = (struct iscsi_nop_in_hdr *)&rsp->pdu.bhs;
- rsp_hdr->opcode = ISCSI_OP_NOOP_IN;
+ rsp_hdr->opcode = ISCSI_OP_NOP_IN;
  rsp_hdr->flags = ISCSI_FLG_FINAL;
  rsp_hdr->itt = req->pdu.bhs.itt;
  rsp_hdr->ttt = cpu_to_be32(ISCSI_RESERVED_TAG);
@@ -1364,8 +1364,8 @@ static void iscsi_cmnd_exec(struct iscsi_cmnd *cmnd)
  dprintk(D_GENERIC, "%p,%x,%u\n", cmnd, cmnd_opcode(cmnd), cmnd->pdu.bhs.sn);
 
  switch (cmnd_opcode(cmnd)) {
- case ISCSI_OP_NOOP_OUT:
- noop_out_exec(cmnd);
+ case ISCSI_OP_NOP_OUT:
+ nop_out_exec(cmnd);
  break;
  case ISCSI_OP_SCSI_CMD:
  scsi_cmnd_exec(cmnd);
@@ -1490,7 +1490,7 @@ void cmnd_tx_start(struct iscsi_cmnd *cmnd)
  conn->write_size = sizeof(cmnd->pdu.bhs);
 
  switch (cmnd_opcode(cmnd)) {
- case ISCSI_OP_NOOP_IN:
+ case ISCSI_OP_NOP_IN:
  cmnd_set_sn(cmnd, 1);
  cmnd_send_pdu(conn, cmnd);
  break;
@@ -1546,7 +1546,7 @@ void cmnd_tx_end(struct iscsi_cmnd *cmnd)
 
  dprintk(D_GENERIC, "%p:%x\n", cmnd, cmnd_opcode(cmnd));
  switch (cmnd_opcode(cmnd)) {
- case ISCSI_OP_NOOP_IN:
+ case ISCSI_OP_NOP_IN:
  case ISCSI_OP_SCSI_RSP:
  case ISCSI_OP_SCSI_TASK_MGT_RSP:
  case ISCSI_OP_TEXT_RSP:
@@ -1661,8 +1661,8 @@ void cmnd_rx_start(struct iscsi_cmnd *cmnd)
  return;
 
  switch (cmnd_opcode(cmnd)) {
- case ISCSI_OP_NOOP_OUT:
- err = noop_out_start(conn, cmnd);
+ case ISCSI_OP_NOP_OUT:
+ err = nop_out_start(conn, cmnd);
  break;
  case ISCSI_OP_SCSI_CMD:
  if (!(err = cmnd_insert_hash(cmnd)))
@@ -1704,7 +1704,7 @@ void cmnd_rx_end(struct iscsi_cmnd *cmnd)
  dprintk(D_GENERIC, "%p:%x\n", cmnd, cmnd_opcode(cmnd));
  switch (cmnd_opcode(cmnd)) {
  case ISCSI_OP_SCSI_REJECT:
- case ISCSI_OP_NOOP_OUT:
+ case ISCSI_OP_NOP_OUT:
  case ISCSI_OP_SCSI_CMD:
  case ISCSI_OP_SCSI_TASK_MGT_MSG:
  case ISCSI_OP_TEXT_CMD:
diff --git a/kernel/iscsi_hdr.h b/kernel/iscsi_hdr.h
index 1233dd2..2cbcd4f 100644
--- a/kernel/iscsi_hdr.h
+++ b/kernel/iscsi_hdr.h
@@ -43,7 +43,7 @@ struct iscsi_hdr {
 #define ISCSI_OPCODE_MASK 0x3F
 
 /* Client to Server Message Opcode values */
-#define ISCSI_OP_NOOP_OUT 0x00
+#define ISCSI_OP_NOP_OUT 0x00
 #define ISCSI_OP_SCSI_CMD 0x01
 #define ISCSI_OP_SCSI_TASK_MGT_MSG 0x02
 #define ISCSI_OP_LOGIN_CMD 0x03
@@ -58,7 +58,7 @@ struct iscsi_hdr {
 #define ISCSI_OP_VENDOR4_CMD 0x1f
 
 /* Server to Client Message Opcode values */
-#define ISCSI_OP_NOOP_IN 0x20
+#define ISCSI_OP_NOP_IN 0x20
 #define ISCSI_OP_SCSI_RSP 0x21
 #define ISCSI_OP_SCSI_TASK_MGT_RSP 0x22
 #define ISCSI_OP_LOGIN_RSP 0x23
diff --git a/usr/iscsi_hdr.h b/usr/iscsi_hdr.h
index 7e2e3e1..6298a67 100644
--- a/usr/iscsi_hdr.h
+++ b/usr/iscsi_hdr.h
@@ -32,7 +32,7 @@ struct iscsi_hdr {
 #define ISCSI_OPCODE_MASK 0x3F
 
 /* Client to Server Message Opcode values */
-#define ISCSI_OP_NOOP_OUT 0x00
+#define ISCSI_OP_NOP_OUT 0x00
 #define ISCSI_OP_SCSI_CMD 0x01
 #define ISCSI_OP_SCSI_TASK_MGT_MSG 0x02
 #define ISCSI_OP_LOGIN_CMD 0x03
@@ -42,7 +42,7 @@ struct iscsi_hdr {
 #define ISCSI_OP_SNACK_CMD 0x10
 
 /* Server to Client Message Opcode values */
-#define ISCSI_OP_NOOP_IN 0x20
+#define ISCSI_OP_NOP_IN 0x20
 #define ISCSI_OP_SCSI_RSP 0x21
 #define ISCSI_OP_SCSI_TASK_MGT_RSP 0x22
 #define ISCSI_OP_LOGIN_RSP 0x23
diff --git a/usr/param.c b/usr/param.c
index 5647bab..9477831 100644
--- a/usr/param.c
+++ b/usr/param.c
@@ -281,12 +281,12 @@ static struct iscsi_key_ops marker_ops = {
  .set_val = marker_set_val,
 };
 
-#define SET_KEY_VALUES(x) DEFAULT_NR_##x,MIN_NR_##x, MAX_NR_##x
+#define SET_KEY_VALUES(x) DEFAULT_##x,MIN_##x, MAX_##x
 
 struct iscsi_key target_keys[] = {
- {"Wthreads", SET_KEY_VALUES(WTHREADS), &minimum_ops},
+ {"Wthreads", SET_KEY_VALUES(NR_WTHREADS), &minimum_ops},
  {"Type", 0, 0, 16, &minimum_ops},
- {"QueuedCommands", SET_KEY_VALUES(QUEUED_CMNDS), &minimum_ops},
+ {"QueuedCommands", SET_KEY_VALUES(NR_QUEUED_CMNDS), &minimum_ops},
  {NULL,},
 };
 
--
1.5.4.3


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel
LightInTheBox - Buy quality products at wholesale price!