Thread (36 messages) 36 messages, 3 authors, 2021-02-19

Re: [PATCH 15/25] target: add gfp_t arg to target_cmd_init_cdb

From: Bodo Stroesser <bostroesser@gmail.com>
Date: 2021-02-19 18:54:34
Also in: target-devel

On 17.02.21 21:28, Mike Christie wrote:
quoted hunk ↗ jump to hunk
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1427,7 +1427,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)
  }
  
  sense_reason_t
-target_cmd_init_cdb(struct se_cmd *cmd, unsigned char *cdb)
+target_cmd_init_cdb(struct se_cmd *cmd, unsigned char *cdb, gfp_t gfp)
  {
  	sense_reason_t ret;
  
@@ -1448,8 +1448,7 @@ target_cmd_init_cdb(struct se_cmd *cmd, unsigned char *cdb)
  	 * setup the pointer from __t_task_cdb to t_task_cdb.
  	 */
  	if (scsi_command_size(cdb) > sizeof(cmd->__t_task_cdb)) {
-		cmd->t_task_cdb = kzalloc(scsi_command_size(cdb),
-						GFP_KERNEL);
+		cmd->t_task_cdb = kzalloc(scsi_command_size(cdb), gfp);
  		if (!cmd->t_task_cdb) {
  			pr_err("Unable to allocate cmd->t_task_cdb"
  				" %u > sizeof(cmd->__t_task_cdb): %lu ops\n",
@@ -1638,6 +1637,7 @@ EXPORT_SYMBOL_GPL(target_init_cmd);
   * @sgl_bidi_count: scatterlist count for bidirectional READ mapping
   * @sgl_prot: struct scatterlist memory protection information
   * @sgl_prot_count: scatterlist count for protection information
+ * @gfp_t: gfp allocation type

Just a nit: shoulodn't it be "@gfp: ..."?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help