DragonFly users List (threaded) for 2008-08
Re: Hammer: Transactional file updates
Daniel Taylor wrote:
--- On Fri, 1/8/08, Michael Neumann <firstname.lastname@example.org> wrote:
fd = open(file); // behaves like START TRANSACTION
close(fd); // behaves like COMMIT
If you want a commit on close, fsync() the file just before you close() it.
That's not what I want. fsync only guarantees that the data is stored
permanently. That's not my problem. I want to ensure that some
write-operations are performed either-all-or-nothing.
That would be fine except that it would give me a new inode
the inode number is right now the only way to associate
with a file.
Why do you care if you get a new inode vs multiple versions of the same inode?
Hammer doesn't reuse inode numbers. So inode numbers could be used as
unique id's to refer to that file (like a ROWID or OID in a database).