Skip to contentSkip to conversation

scsi: target: tcmu: Remove unnecessary bit TCMU_CMD_BIT_INFLIGHT

PATCH Applied Bodo Stroesser 3 participants 3 messages Jun 19, 2020 – Jun 20, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: target: tcmu: Remove unnecessary bit TCMU_CMD_BIT_INFLIGHT

Since
commit 61fb24822166 ("scsi: target: tcmu: Userspace must not complete
queued commands")
tcmu_cmd bit TCMU_CMD_BIT_INFLIGHT is set but never checked. So we can remove it safely.

---
 drivers/target/target_core_user.c | 2 --
 1 file changed, 2 deletions(-)
drivers/target/target_core_user.c +0 -2
index 560bfec933bc..b38da27e033f 100644
@@ -181,7 +181,6 @@ struct tcmu_cmd {
 	unsigned long deadline;
 
 #define TCMU_CMD_BIT_EXPIRED 0
-#define TCMU_CMD_BIT_INFLIGHT 1
 	unsigned long flags;
 };
 /*
@@ -1078,7 +1077,6 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err)
 	tcmu_flush_dcache_range(mb, sizeof(*mb));
 
 	list_add_tail(&tcmu_cmd->queue_entry, &udev->inflight_queue);
-	set_bit(TCMU_CMD_BIT_INFLIGHT, &tcmu_cmd->flags);
 
 	/* TODO: only if FLUSH and FUA? */
 	uio_event_notify(&udev->uio_info);
Signature · 1 line
2.12.3
Acked-by Mike Christie on v1 1/1
#1 lore raw
Quoted 28 lines · Bodo Stroesser

Since
commit 61fb24822166 ("scsi: target: tcmu: Userspace must not complete queued commands")
tcmu_cmd bit TCMU_CMD_BIT_INFLIGHT is set but never checked. So we can remove it safely.

---
drivers/target/target_core_user.c | 2 --

1 file changed, 2 deletions(-)
drivers/target/target_core_user.c +0 -1
index 560bfec933bc..b38da27e033f 100644
@@ -181,7 +181,6 @@ struct tcmu_cmd {
 	unsigned long deadline;
 
 #define TCMU_CMD_BIT_EXPIRED 0
-#define TCMU_CMD_BIT_INFLIGHT 1
 	unsigned long flags;
 };
 /*

drivers/target/target_core_user.c static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err) · line 1082

Quoted 7 lines
drivers/target/target_core_user.c +0 -1
@@ -1078,7 +1077,6 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err)
 	tcmu_flush_dcache_range(mb, sizeof(*mb));
 
 	list_add_tail(&tcmu_cmd->queue_entry, &udev->inflight_queue);
-	set_bit(TCMU_CMD_BIT_INFLIGHT, &tcmu_cmd->flags);
 
 	/* TODO: only if FLUSH and FUA? */
 	uio_event_notify(&udev->uio_info);
#2 lore raw
In reply to Bodo Stroesser
Quoted 5 lines · Bodo Stroesser

Since
commit 61fb24822166 ("scsi: target: tcmu: Userspace must not complete
queued commands")
tcmu_cmd bit TCMU_CMD_BIT_INFLIGHT is set but never checked. So we can remove it safely.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: target: tcmu: Remove unnecessary bit TCMU_CMD_BIT_INFLIGHT

      https://git.kernel.org/mkp/scsi/c/da3f28da1c27
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering