ENUM REQ_OP(9)
π enum req_op β the kernel API manual, but make it cute
okay so bestie, this is enum req_op from the Kernel API Manual, and it's literally the blueprint for "what kind of I/O are we even doing" in the block layer. π
β¨ NAME β¨
enum req_op β Operations common to the bio and request structures. We use 8 bits for encoding the operation, and the remaining 24 for flags. no cap, that's the whole bit budget right there π
πΈ SYNOPSIS πΈ
enum req_op {
REQ_OP_READ ,
REQ_OP_WRITE ,
REQ_OP_FLUSH ,
REQ_OP_DISCARD ,
REQ_OP_SECURE_ERASE ,
REQ_OP_ZONE_APPEND ,
REQ_OP_WRITE_ZEROES ,
REQ_OP_ZONE_OPEN ,
REQ_OP_ZONE_CLOSE ,
REQ_OP_ZONE_FINISH ,
REQ_OP_ZONE_RESET ,
REQ_OP_ZONE_RESET_ALL
};
like, twelve ops, all iconic, all in order, don't touch them π
π¦ Constants π¦
REQ_OP_READβ read sectors from the device πREQ_OP_WRITEβ write sectors to the device βοΈREQ_OP_FLUSHβ flush the volatile write cache π½ (ok not literally but the vibe is there)REQ_OP_DISCARDβ discard sectors ποΈREQ_OP_SECURE_ERASEβ securely erase sectors πREQ_OP_ZONE_APPENDβ write data at the current zone write pointer πREQ_OP_WRITE_ZEROESβ write the zero filled sector many times 0οΈβ£0οΈβ£0οΈβ£REQ_OP_ZONE_OPENβ Open a zone πREQ_OP_ZONE_CLOSEβ Close a zone πREQ_OP_ZONE_FINISHβ Transition a zone to full π΅REQ_OP_ZONE_RESETβ reset a zone write pointer πREQ_OP_ZONE_RESET_ALLβ reset all the zone present on the device πͺοΈ
π Description π
so the least significant bit of the operation number is basically the main character here β it tells you which way the data is flowing, iykyk:
- if the least significant bit is set, transfers are TO the device π₯
- if the least significant bit is not set, transfers are FROM the device π€
and if an operation does not transfer data? then the least significant bit has no meaning. it's just there, vibing, contributing nothing. we've all been there tbh π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/blk_types.h blk_path_error(9)
fr fr, the whole thing lives under./include/linux, dated October 2026, and this page isenum req_op(9). slay, go readblk_types.hbestie π«Άβ¨π
π¦ 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