[PATCH 3/4] target/user: Fix comments to not refer to data ring
Tim Gardner
tim.gardner at canonical.com
Tue Dec 6 19:40:54 UTC 2016
From: Andy Grover <agrover at redhat.com>
BugLink: http://bugs.launchpad.net/bugs/1646204
We no longer use a ringbuffer for the data area, so this might cause
confusion. Just call it the data area.
Signed-off-by: Andy Grover <agrover at redhat.com>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Mike Christie <mchristi at redhat.com>
Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org>
(back ported from commit 3d9b95558f5874ac5d63a057813dc66b480de7e1)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
Conflicts:
drivers/target/target_core_user.c
---
drivers/target/target_core_user.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index c252528..f383561 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -92,7 +92,7 @@ struct tcmu_dev {
size_t dev_size;
u32 cmdr_size;
u32 cmdr_last_cleaned;
- /* Offset of data ring from start of mb */
+ /* Offset of data area from start of mb */
size_t data_off;
size_t data_size;
/* Ring head + tail values. */
@@ -339,7 +339,7 @@ static void gather_and_free_data_area(struct tcmu_dev *udev,
/*
* We can't queue a command until we have space available on the cmd ring *and*
- * space available on the data ring.
+ * space available on the data area.
*
* Called with ring lock held.
*/
@@ -426,7 +426,7 @@ tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)
if ((command_size > (udev->cmdr_size / 2)) ||
data_length > udev->data_size) {
pr_warn("TCMU: Request of size %zu/%zu is too big for %u/%zu "
- "cmd/data ring buffers\n", command_size, data_length,
+ "cmd ring/data area\n", command_size, data_length,
udev->cmdr_size, udev->data_size);
spin_unlock_irq(&udev->cmdr_lock);
return TCM_INVALID_CDB_FIELD;
@@ -479,9 +479,7 @@ tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)
entry->hdr.kflags = 0;
entry->hdr.uflags = 0;
- /*
- * Fix up iovecs, and handle if allocation in data ring wrapped.
- */
+ /* Handle allocating space from the data area */
iov = &entry->req.iov[0];
iov_cnt = 0;
copy_to_data_area = (se_cmd->data_direction == DMA_TO_DEVICE
@@ -548,8 +546,10 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry *
struct tcmu_dev *udev = cmd->tcmu_dev;
if (test_bit(TCMU_CMD_BIT_EXPIRED, &cmd->flags)) {
- /* cmd has been completed already from timeout, just reclaim data
- ring space */
+ /*
+ * cmd has been completed already from timeout, just reclaim
+ * data area space and free cmd
+ */
UPDATE_HEAD(udev->data_tail, cmd->data_length, udev->data_size);
return;
}
--
2.7.4
More information about the kernel-team
mailing list