Message ID | cover.1740753608.git.dsterba@suse.com (mailing list archive) |
---|---|
Headers | show |
Series | Ioctl to clear unused space in various ways | expand |
On Fri, Feb 28, 2025 at 03:49:20PM +0100, David Sterba wrote: > Add ioctl that is similar to FITRIM and in addition to trim can do also > zeroing (either plain overwrite, or unmap the blocks if the device > supports it) and secure erase. > > This can be used to zero the unused space in e.g. VM images (when run > from inside the guest, if fstrim is not supported) or free space on > thin-provisioned devices. > > The secure erase is provided by blkdiscard command but I'm not aware of > equivalent that can be run on a filesystem, so this is for parity. For current implementation of TRIM we have the in-memory cache that tracks which chunks have been trimmed so it's not duplicating the IO. As the CLEAR code builds on tre trim code the cache would apply to any of the new modes, which is probably not what we want.