When a file is edited/modified by the user, how and when are blocks returned to the space map?
I have created a small (43 bytes, one 512 block) text file. When I write the text file to a ZFS pool, I see calls to metaslab_alloc and space_map_remove. When I delete the text file, I see calls to metaslab_free, and space_map_add. This makes sense. However, if I write the same file to a ZFS pool, then change a few characters using a text editor and save it, I see calls to metaslab_alloc and space_map_remove for the new contents of the modified block, but I never see calls to metaslab_free and space_map_add to return the original block to the space map. When and where does the free of the original, no longer used block occur? I am also a bit confused about why I see a space_map_remove AND a space_map_add during the metaslab_alloc sequence. I understand the space_map_remove, but why is there also a call to space_map_add? Duff -- This messages posted from opensolaris.org