goto busy;
}
- if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0))
+ if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0,
+ GFP_KERNEL))
return;
target_submit(cmd);
if (rc)
return rc;
- if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0))
+ if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0,
+ GFP_KERNEL))
return 0;
target_submit(se_cmd);
target_get_sess_cmd(&cmd->se_cmd, true);
- cmd->sense_reason = target_cmd_init_cdb(&cmd->se_cmd, hdr->cdb);
+ cmd->sense_reason = target_cmd_init_cdb(&cmd->se_cmd, hdr->cdb,
+ GFP_KERNEL);
if (cmd->sense_reason) {
if (cmd->sense_reason == TCM_OUT_OF_RESOURCES) {
return iscsit_add_reject_cmd(cmd,
if (target_submit_prep(se_cmd, sc->cmnd, scsi_sglist(sc),
scsi_sg_count(sc), sgl_bidi, sgl_bidi_count,
- scsi_prot_sglist(sc), scsi_prot_sg_count(sc)))
+ scsi_prot_sglist(sc), scsi_prot_sg_count(sc),
+ GFP_NOIO))
return;
target_submit(se_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;
* 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",
* @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: gfp allocation type
*
* Returns:
* - less than zero to signal failure.
int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
struct scatterlist *sgl, u32 sgl_count,
struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
- struct scatterlist *sgl_prot, u32 sgl_prot_count)
+ struct scatterlist *sgl_prot, u32 sgl_prot_count,
+ gfp_t gfp)
{
sense_reason_t rc;
- rc = target_cmd_init_cdb(se_cmd, cdb);
+ rc = target_cmd_init_cdb(se_cmd, cdb, gfp);
if (rc)
goto send_cc_direct;
if (rc)
return;
- if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0))
+ if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0,
+ GFP_KERNEL))
return;
target_submit(se_cmd);
}
cmd->se_cmd_flags |= SCF_SE_LUN_CMD;
- if (target_cmd_init_cdb(cmd, cdb))
+ if (target_cmd_init_cdb(cmd, cdb, GFP_KERNEL))
return -EINVAL;
cmd->tag = 0;
goto err;
if (target_submit_prep(&cmd->se_cmd, fcp->fc_cdb, NULL, 0, NULL, 0,
- NULL, 0))
+ NULL, 0, GFP_KERNEL))
return;
target_submit(&cmd->se_cmd);
if (target_submit_prep(se_cmd, cmd->tvc_cdb, sg_ptr,
cmd->tvc_sgl_count, NULL, 0, sg_prot_ptr,
- cmd->tvc_prot_sgl_count))
+ cmd->tvc_prot_sgl_count, GFP_KERNEL))
return;
target_submit(se_cmd);
pending_req->sc_data_direction, TARGET_SCF_ACK_KREF);
if (target_submit_prep(se_cmd, pending_req->cmnd, pending_req->sgl,
- pending_req->n_sg, NULL, 0, NULL, 0))
+ pending_req->n_sg, NULL, 0, NULL, 0, GFP_KERNEL))
return;
target_submit(se_cmd);
int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
struct scatterlist *sgl, u32 sgl_count,
struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
- struct scatterlist *sgl_prot, u32 sgl_prot_count);
+ struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp);
void target_submit(struct se_cmd *se_cmd);
sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
-sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *);
+sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
+ gfp_t gfp);
sense_reason_t target_cmd_parse_cdb(struct se_cmd *);
void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
unsigned char *, u64, u32, int, int, int);