scsi_kmap_atomic_sg(9)
π« scsi_kmap_atomic_sg π«
okay bestie, welcome to the Kernel API Manual β this one's a little function from the SCSI corner of the kernel and it's genuinely so useful, so let's get into it π«Ά
β¨ NAME β¨
scsi_kmap_atomic_sg β find and atomically map an sg-elemnt π
(yes, "elemnt". that's how it's spelled in the source. we respect the typo here, no cap π)
πΈ SYNOPSIS πΈ
void * scsi_kmap_atomic_sg (struct scatterlist *sgl , int sg_count ,
size_t *offset , size_t *len );
π¦ ARGUMENTS π¦
sglβ the scatter-gather list, aka the lineup of memory pieces you're working with πsg_countβ number of segments in sg, like how many baddies are in the group chatoffsetβ offset in bytes into sg, and on return it's the offset into the mapped area (yes it does double duty, main character behavior tbh π)lenβ bytes to map, and on return it's the number of bytes mapped β¨
π DESCRIPTION π
Returns virtual address of the start of the mapped page. that's it, that's the whole vibe. a void * straight to the good stuff π
π₯ SEE ALSO π₯
Kernel file ./drivers/scsi/scsi_lib.c β go read it, it's lowkey iconic π
and now, the extended universe, because there are literally 40 of these and i'm not skipping a single one, periodt:
__scsi_queue_insert(9)scsi_queue_insert(9)scsi_failures_reset_retries(9)scsi_check_passthrough(9)scsi_execute_cmd(9)scsi_run_queue(9)scsi_result_to_blk_status(9)scsi_rq_err_bytes(9)scsi_io_completion(9)scsi_alloc_sgtables(9)scsi_initialize_rq(9)scsi_alloc_request(9)scsi_dispatch_cmd(9)scsi_get_internal_cmd(9)scsi_put_internal_cmd(9)scsi_device_from_queue(9)scsi_block_requests(9)scsi_unblock_requests(9)scsi_mode_select(9)scsi_mode_sense(9)scsi_test_unit_ready(9)scsi_device_set_state(9)scsi_evt_emit(9)scsi_evt_thread(9)sdev_evt_send(9)sdev_evt_alloc(9)sdev_evt_send_simple(9)scsi_device_quiesce(9)scsi_device_resume(9)scsi_internal_device_block_nowait(9)scsi_device_block(9)scsi_internal_device_unblock_nowait(9)scsi_internal_device_unblock(9)scsi_block_targets(9)scsi_host_block(9)scsi_kunmap_atomic_sg(9)scsi_vpd_lun_id(9)scsi_vpd_lun_serial(9)scsi_vpd_tpg_id(9)scsi_build_sense(9)
all 40, accounted for, nobody left on read π
ngl bestie, scsi_kunmap_atomic_sg(9) is right there in that list for a reason β if you map it, you're gonna have to unmap it. do not forget. i'm not saying you would. i'm just saying. π
k bye love u, this page came to you from ./drivers/scsi, dated October 2026, and it's the scsi_kmap_atomic_sg(9) page β slay, go map something atomically π§ββοΈπ
π¦ 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