__blkdev_issue_zeroout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __blkdev_issue_zeroout(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ β€” this is the page for __blkdev_issue_zeroout, and yes it's a double-underscore icon, we respect her πŸ’…


🌸 NAME 🌸

__blkdev_issue_zeroout β€” generate number of zero filled write bios πŸŽ€ like, it makes a whole bunch of zero-write bios for you, no cap


✨ SYNOPSIS ✨

int __blkdev_issue_zeroout (struct block_device *bdev , sector_t sector
, sector_t nr_sects , gfp_t gfp_mask , struct bio **biop , unsigned
flags );

that's the whole signature, copied exactly, don't @ me 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bdev β€” the blockdev to issue πŸ’« it's a struct block_device *, she's the main character here
  • sector β€” start sector 🌸 where the zeroing begins, bestie
  • nr_sects β€” number of sectors to write ⭐ count 'em
  • gfp_mask β€” memory allocation flags (for bio_alloc) πŸ’œ iykyk
  • biop β€” pointer to anchor bio πŸŽ€ it's a struct bio **, so, a pointer to a pointer, stay with me
  • flags β€” controls detailed behavior πŸ”₯ the little switches that change the vibe check

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does she actually do? Zero-fill a block range, either using hardware offload or by explicitly writing zeroes to the device. literally both paths lead to zeroes, she just picks how πŸ’…

now, the caveats β€” pay attention, this is the important part πŸ™ˆ

  • If a device is using logical block provisioning, the underlying space will not be released if flags contains BLKDEV_ZERO_NOUNMAP. so like, the space stays taken, fr fr
  • If flags contains BLKDEV_ZERO_NOFALLBACK, the function will return -EOPNOTSUPP if no explicit hardware offload for zeroing is provided. so if there's no offload, she just ✨ gives up ✨ and hands you back -EOPNOTSUPP
bestie pls note: those two flags are the whole personality of this function, don't mix them up 🫢

🌈 SEE ALSO 🌈

all three, listed, exactly, periodt πŸ’…


and that's the page!! 🧚 mwah πŸ’–

sign-off: this whole thing came from ./block, dated October 2026 β€” Kernel API Manual energy only. stay slay, stay zeroed βœ¨πŸ‘‘
πŸ“¦ where this page comes from