The mini_fo filesystem
Posted May 21, 2005 6:03 UTC (Sat) by AnswerGuy
In reply to: The mini_fo filesystem
Parent article: The mini_fo filesystem
I don't know the answer to that question in this case, but consider that
a "rename" is really series of link and unlink operations (at the system
call level). Also a directory is a type of file (a list of link/inode
Given those semantics I'd guess that a "rename" would unlink on the
top/writable layer (writing a version of the directory that did NOT
contain the link in question) and a link (possibly to that same directory
possibly to another) resulting in more writes to the writable layer.
This wouldn't affect the underlying inode (but that would probably
be copied up from the lower layer to the write layer because the
link count was incremented and then decremented).
So know I have one or two directory "files" that contain updated
contents (like any other file that got copied up to the writable
layer). The ls command (and other readdir() operations) will show
the copy of the directory that does not contain the old name and does
contain the new one.
Is this making any sense?
I do have to wonder what happens if you have multiple layers that are
writable and mounted in multiple places (bind mounts of some layers
outside of the stack). That sounds ugly.
to post comments)