blkdev_issue_discard(9)
β¨ blkdev_issue_discard(9) β¨
okay so this is blkdev_issue_discard from the Kernel API Manual β yes, that Kernel API Manual, the one and only π β and bestie, it's literally the function that queues a discard. that's the whole vibe. let's get into it π
πΈ NAME πΈ
blkdev_issue_discard β queue a discard π
π¦ SYNOPSIS π¦
int blkdev_issue_discard (struct block_device *bdev , sector_t sector ,
sector_t nr_sects , gfp_t gfp_mask );
like, that's the whole signature. four args. she's not complicated, she's just precise β¨
π ARGUMENTS π
bdevβ the blockdev you're issuing the discard for. this is the main character right here πsectorβ the start sector. where the whole thing kicks off πnr_sectsβ how many sectors you're discarding. the number. the amount. the count πgfp_maskβ memory allocation flags β and fr fr, these are specifically forbio_alloc. don't forget that part, iykyk π
π₯ DESCRIPTION π₯
Issue a discard request for the sectors in question. that's it. that's the function. she takes your sectors, she queues the discard, she moves on with her life π β¨
π SEE ALSO π
- the Kernel file
./block/blk-lib.c __blkdev_issue_zeroout(9)blkdev_issue_zeroout(9)
like, go read those too, they're the friend group π«Ά
and that's a wrap bestie!! this page lives in ./block, dated October 2026, and it's filed as blkdev_issue_discard(9) β no cap, go queue some discards responsibly ππΈβ
π¦ 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