Re: [PATCH 14/14] target: remove target_submit_cmd_map_sgls

Christoph Hellwig
2021-02-11T15:21:14Z

> + * This function must only be used by drivers that do their own
> + * sync during shutdown and does not use target_stop_session. If there
> + * is a failure this function will call into the fabric driver's
> + * queue_status with a CHECK_CONDITION.
> */
> -int target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
> +void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
> unsigned char *cdb, unsigned char *sense, u64 unpacked_lun,
> u32 data_length, int task_attr, int data_dir, int flags)
> {
> + target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, data_length,
> + task_attr, data_dir, flags);
> + target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0);

Do we want a WARN_ON_ONCE here to catch the case where the API is
misued?