Skip to contentSkip to conversation

Atomicity/Journaling in VFS layer

QUESTION Vyacheslav NightFlash 1 participant 1 message Apr 29, 2004

lore
Share & tools
lore
#0 lore raw

Seems that all journaling filesystems ordering their ondisk modifications somehow Isn't it better to add ability to order data/metadata modifications to VFS layer?

Also hacking VFS is the only way to provide data consistency if application want "write A" to appear before "write B", but A and B are on different filesystems.

I have some ideas how it could be done, but I dont know VFS much, so I'll be happy to see comments from guru.

1) Every inode keeps list of "atoms".

2) Every "atom" keeps list of modified buffers, that can appear in ondisk FS layout only together.

3) "atom" keeps list of "atom"s, that must be commited before it can start its own writeback.

4) "atom" keeps list of "atom"s that are waiting for its commit, so that they can be marked as "ready for writeback" as a part of its io completition.

5) We can assign virtual inodes to journals & metadata structures, so we can track data-journal-metadata write order using the same "atom dependencies"

6) When process writes to fd new "atom" is created. It initialized so that in could not be written before commit of data that process has read/wrote before this "atom" creation.

7) Every buffer has link to his atom (or NULL if it's clean). So we can add some more "dependencies" to atom that owns buffer.