Skip to content

Commit 11bf1d1

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: target: core: Document target_cmd_size_check()
Since it is nontrivial to derive the meaning of the size argument from the code, add a documentation header above target_cmd_size_check(). Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 29d28f2 commit 11bf1d1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/target/target_core_transport.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,19 @@ target_check_max_data_sg_nents(struct se_cmd *cmd, struct se_device *dev,
12431243
return TCM_NO_SENSE;
12441244
}
12451245

1246+
/**
1247+
* target_cmd_size_check - Check whether there will be a residual.
1248+
* @cmd: SCSI command.
1249+
* @size: Data buffer size derived from CDB. The data buffer size provided by
1250+
* the SCSI transport driver is available in @cmd->data_length.
1251+
*
1252+
* Compare the data buffer size from the CDB with the data buffer limit from the transport
1253+
* header. Set @cmd->residual_count and SCF_OVERFLOW_BIT or SCF_UNDERFLOW_BIT if necessary.
1254+
*
1255+
* Note: target drivers set @cmd->data_length by calling transport_init_se_cmd().
1256+
*
1257+
* Return: TCM_NO_SENSE
1258+
*/
12461259
sense_reason_t
12471260
target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
12481261
{

0 commit comments

Comments
 (0)