On 2025/1/6 19:27, Christoph Hellwig wrote: > There's a feature request for something similar on the xfs list, so > I guess people are asking for it. > > That being said this really should not be a modifier but a separate > operation, as the logic is very different from FALLOC_FL_ZERO_RANGE, > similar to how plain prealloc, hole punch and zero range are different > operations despite all of them resulting in reads of zeroes from the > range. OK, it seems reasonable to me, and adding a new operation would be better. There is actually no need to mix it with the current FALLOC_FL_ZERO_RANGE. > > That will also make it more clear that for files or file systems that > require out place writes this operation should fail instead of doing > pointless multiple writes. > > Also please write a man page update clearly specifying the semantics, > especially if this should work or not if there is no write zeroes > offload in the hardware, or if that offload actually writes physical > zeroes to the media or not. > Sure. thanks for your advice. Thanks, Yi. > Btw, someone really should clean up the ext4 fallocate code to use > helper adnd do the > > switch (mode & FALLOC_FL_MODE_MASK) { > } > > and then use helpers for each mode whih will make these things a lot > more obvious.