Hammer: Transactional file updates

Michael Neumann mneumann at ntecs.de
Fri Aug 1 14:54:11 PDT 2008


Daniel Taylor wrote:
--- On Fri, 1/8/08, Michael Neumann <mneumann at ntecs.de> wrote:

   fd = open(file);  // behaves like START TRANSACTION
   read(fd, ...);
   write(fd, ...);
   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
number, and
the inode number is right now the only way to associate
further data
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).
Regards,

  Michael





More information about the Users mailing list