DragonFly users List (threaded) for 2008-08
DragonFly BSD
DragonFly users List (threaded) for 2008-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Hammer: Transactional file updates


From: Michael Neumann <mneumann@xxxxxxxx>
Date: Fri, 01 Aug 2008 23:47:36 +0200

Daniel Taylor wrote:
--- On Fri, 1/8/08, Michael Neumann <mneumann@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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]