4 ms·
Theoretically, if the number of bytes to be removed were a multiple of FS data block size (usually an inode size), it should be possible to unlink that inode as
by vkaku 7y ago
Theoretically, if the number of bytes to be removed were a multiple of FS data block size (usually an inode size), it should be possible to unlink that inode as well, and rewrite the metadata. It probably involves fewer shifts and fewer bytes/time wasted.
In general, if you intend to create structures that allow one to reduce file size, reclaim the data, defragment - that sort of thing, a rewrite/coalesce happens to be the viable solution. In general, if allowed to increase, fragmentation will worsen with time.