tech-kern archive

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

Re: syncing a directory

Actually, we do have that: fsync_range(fd, FDISKSYNC, ...).
Oh, interesting things for me to learn here.

So, is there possibly a way to explicitly synchronise a whole directory? I mean the data that, in the old days, you could just have write()-ten to the "everything is a file" directory? I'm somewhat unsure about the use of the term "metadata" here. I don't know whether one would call the fact that /tmp contains an entry foo metadata of /tmp/foo or simply part of the data of /tmp.

To be more specific: suppose you have created a bunch of files in (maildir) tmp/, and fsync()ed each of them. Now you move all of them to new/. Is there a better way of ensuring they will still show up in new/ in case the machine crashes other than fsync()ing each file again? I understand that fsync()ing the file not before, but only after the move is not an option because that would make it possible for incomplete files showing up in cur/.

Thanks for your answers.

Home | Main Index | Thread Index | Old Index