Candy wrote:
I'm working on the *FS mkfs tool. It works up to the level that I've come to the part where you take minute decisions that make a huge impact later on.
I'm implementing the support for copy-on-write files, where a file inode is shared by multiple file links, which can only write to it by copying it before the actual write. This works fine. I am considering, if you allow this for directory inodes as well, writing a file includes checking all of its predecessors and possibly copying a number of them. Not allowing this would weaken it since you'd still get loads of copies of the directory tree.
What do you think?
So when it's sharing time,only links(references) will be added to indicate the shared files;and only when actually writing occurs will they be copied?
The key point is that links(pointers or references) are seperated from the contents(datas),may I understand it like that?
Will a shared file be completely copy when it's going to be written through one or more links(sometimes it's unnecessary or may slow down the process)?Or you're going to generate additional minimal descriptions to specify just what(which copy and the location within it) is modified(when the file is read next time,the FS will combine the original one and the certain modification description (related to the requested copy) to return a final output)?
Generally I think,if the backup is for updating in different period,that will work fine.
Anyway,I think that's good.
Combuster wrote:
Sounds like: "Why would we put a jet engine into a motor cycle?"
Answer: "Because we can"
Apart from that, I like the idea. And since you are COWing files, doing it for directories is just the logical next step.
Yeah...
Copy-on-write may help more in a distributed system,however similar techniques can also be valubale in desktop areas.