target_submit_prep(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… target_submit_prep β€” prepare cmd for submission πŸŽ€

okay bestie, welcome to the Kernel API Manual (section 9, the fancy kernel-functions part ✨). today we're looking at target_submit_prep, and honestly? she's a prep queen. she gets your cmd all ready for submission. no cap. πŸ¦‹


✨ NAME ✨

target_submit_prep β€” prepare cmd for submission πŸ’–


🌸 SYNOPSIS 🌸

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 ,
gfp_t gfp );

like, look at all those args. she's got range. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • se_cmd β€” the command descriptor to prep, aka the main character of this whole operation πŸ‘‘
  • cdb β€” pointer to the SCSI CDB, fr fr
  • sgl β€” the struct scatterlist memory for unidirectional mapping
  • sgl_count β€” the scatterlist count for that unidirectional mapping
  • sgl_bidi β€” the struct scatterlist memory for bidirectional READ mapping (yes, bidi, she goes both ways πŸ’…)
  • sgl_bidi_count β€” scatterlist count for the bidirectional READ mapping
  • sgl_prot β€” the struct scatterlist memory protection information
  • sgl_prot_count β€” scatterlist count for the protection information
  • gfp β€” the gfp allocation type

πŸ¦‹ RETURN πŸ¦‹

vibe check on what you get back:

  • less than zero to signal failure 😭
  • zero on success ✨ slay

🧚 DESCRIPTION 🧚

so here's the tea: if failure is returned, lio will the callers queue_status to complete the cmd. like, that's literally what it says, and that's literally what happens. no notes. πŸ’€


πŸ’œ SEE ALSO πŸ’œ

the kernel file: ./drivers/target/target_core_transport.c

and the whole friend group, bestie β€” go say hi to:

transport_init_session(9), transport_alloc_session(9), transport_alloc_session_tags(9), transport_init_session_tags(9), target_cmd_size_check(9), target_init_cmd(9), target_submit_cmd(9), target_queue_submission(9), target_submit(9), target_submit_tmr(9), target_get_sess_cmd(9), target_put_sess_cmd(9), target_stop_cmd_counter(9), target_stop_session(9), target_wait_for_cmds(9), target_wait_for_sess_cmds(9), transport_wait_for_tasks(9), translate_sense_reason(9), target_send_busy(9)


πŸ“ reminder: the synopsis args are case-sensitive and very much not vibe-based. copy them exactly, bestie. πŸ™ˆ

mwah πŸ’‹ that's the whole page! this icon of a manpage lives in ./drivers/target and it's dated October 2026 β€” so like, mark your calendar, periodt. ⭐🌈

πŸ“¦ where this page comes from