fc_fcp_lock_pkt(9)
π fc_fcp_lock_pkt β from the Kernel API Manual, bestie β¨
Okay so we're diving into fc_fcp_lock_pkt(9) today and honestly? She's a lil' function with main character energy. Let's get into it π«Ά
β¨ NAME β¨
fc_fcp_lock_pkt β locks a fcp_pkt and bumps up its reference count. Lock it, count it, slay π
π¦ SYNOPSIS π¦
int fc_fcp_lock_pkt (struct fc_fcp_pkt *fsp );
πΈ ARGUMENTS πΈ
fspβ the FCP packet that's getting locked and incremented. She's getting the full glow-up treatment, no cap. π₯
π DESCRIPTION π
So the vibe here is: we should only return an error if we hand a command back to SCSI-ml before we've actually gotten a response. Periodt.
When does that even happen? It can happen in cases where we send an abort but don't wait around for the response β and then the abort and the command end up passing each other on the wire / network-layer π like two besties walking past each other in the hallway, both too distracted to notice. Awkward.
π NOTE π
Lowkey the whole point of this function: it locks the packet and grabs a reference, so callers can call the completion function while the lock is held and not have to worry about the packet's refcount. Stress-free living πββοΈ
TODO: Maybe we should just have callers grab/release the lock and have a function that they call to verify the fsp and grab a ref if needed. (The devs are workshopping it, okay, be patient π)
π SEE ALSO π
The source file first, bestie: ./drivers/scsi/libfc/fc_fcp.c β and then, like, the entire friend group:
struct fc_fcp_internal(9)fc_fcp_pkt_alloc(9)fc_fcp_pkt_release(9)fc_fcp_pkt_hold(9)fc_fcp_pkt_destroy(9)fc_fcp_unlock_pkt(9)fc_fcp_timer_set(9)fc_fcp_send_abort(9)fc_fcp_retry_cmd(9)fc_fcp_ddp_setup(9)fc_fcp_ddp_done(9)fc_fcp_can_queue_ramp_up(9)fc_fcp_can_queue_ramp_down(9)get_fsp_rec_tov(9)fc_fcp_recv_data(9)fc_fcp_send_data(9)fc_fcp_abts_resp(9)fc_fcp_recv(9)fc_fcp_resp(9)fc_fcp_complete_locked(9)fc_fcp_cleanup_cmd(9)fc_fcp_cleanup_each_cmd(9)fc_fcp_abort_io(9)fc_fcp_pkt_send(9)fc_fcp_cmd_send(9)fc_fcp_error(9)fc_fcp_pkt_abort(9)fc_lun_reset_send(9)fc_lun_reset(9)fc_tm_done(9)fc_fcp_cleanup(9)fc_fcp_timeout(9)fc_fcp_rec(9)fc_fcp_rec_resp(9)fc_fcp_rec_error(9)fc_fcp_recovery(9)fc_fcp_srr(9)fc_fcp_srr_resp(9)fc_fcp_srr_error(9)fc_fcp_lport_queue_ready(9)fc_queuecommand(9)fc_io_compl(9)fc_eh_abort(9)fc_eh_device_reset(9)fc_eh_host_reset(9)fc_sdev_init(9)fc_fcp_destroy(9)fc_fcp_init(9)
That's the whole page, babes π This lil' icon lives in the source tree at ./drivers/scsi/libfc, and she was stamped with love in October 2026. Go forth and lock responsibly β mwah ππ¦β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms