fc_fcp_lock_pkt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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