Thread (76 messages) 76 messages, 6 authors, 2016-08-04

Re: [PATCH 28/45] target: use bio op accessors

From: Hannes Reinecke <hare@suse.de>
Date: 2016-06-06 15:43:46
Also in: dm-devel, linux-bcache, linux-block, linux-btrfs, linux-f2fs-devel, linux-fsdevel, linux-raid, linux-scsi, linux-xfs, lkml, ocfs2-devel

On 06/06/2016 05:40 PM, Mike Christie wrote:
On 06/06/2016 01:46 AM, Hannes Reinecke wrote:
quoted
On 06/05/2016 09:32 PM, mchristi@redhat.com wrote:
quoted
From: Mike Christie <redacted>

Separate the op from the rq_flag_bits and have the target layer
set/get the bio using bio_set_op_attrs/bio_op.

Signed-off-by: Mike Christie <redacted>
---
  drivers/target/target_core_iblock.c | 29 ++++++++++++++---------------
  drivers/target/target_core_pscsi.c  |  2 +-
  2 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c25109c..22af12f 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
[ .. ]
quoted
@@ -689,18 +690,15 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
  		 * Force writethrough using WRITE_FUA if a volatile write cache
  		 * is not enabled, or if initiator set the Force Unit Access bit.
  		 */
+		op = REQ_OP_WRITE;
  		if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
  			if (cmd->se_cmd_flags & SCF_FUA)
-				rw = WRITE_FUA;
+				op_flags = WRITE_FUA;
  			else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
-				rw = WRITE_FUA;
-			else
-				rw = WRITE;
-		} else {
-			rw = WRITE;
+				op_flags = WRITE_FUA;
  		}
Wrong intendation.
It should be ok. That line is for the QUEUE_FLAG_WC test. We end up with:

op = REQ_OP_WRITE;
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
	if (cmd->se_cmd_flags & SCF_FUA)
		op_flags = WRITE_FUA;
	else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
		op_flags = WRITE_FUA;
}


Indeed, you are correct.

Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help