[Toybox] [PATCH] vi: Replace linelist with mem_block based design

Rob Landley rob at landley.net
Fri Jan 17 18:26:47 PST 2020


On 1/17/20 12:13 AM, enh wrote:
>> Yeah i was thinking of saving temp file and then unloading mmap and
>> original file (and rest of my allocated blocks) and then rename() and
>> for extra cheese maybe file permissions and such need to be copied
>> from original file...
> 
> i think vim does the opposite --- it renames the existing file, then
> writes to the old file name, then unlinks the renamed original if
> everything goes okay.

Which still means there's a moment where a log replay produces a filesystem that
hasn't got a usable copy of that file at that name. (Rename is atomic and
deletes the target dentry, why would they _not_ do that? They've already got
.$FILENAME.sw? files lying around after every unexpected poweroff.)

Rob

P.S. By the way, any BIOS that wakes the system up from suspend because the
power got too low needs a way to shut that off. I'm aware it's signaling windows
to save to disk, but I've yet to encounter a Linux that actually notices. It
just means "I have 2 more hours of suspend time to plug this in" turns into "my
laptop is very hot coming out of my bag, and the battery's dead".



More information about the Toybox mailing list