atomic file operations

David Woodhouse dwmw2 at infradead.org
Thu Mar 24 16:59:53 EST 2005


On Wed, 2005-03-23 at 20:50 +0000, Sergei Sharonov wrote:
> I believe I saw a proposal to save small chunks as separate files,
> then append them as a temp file and rename temp file to real log
> file. 
> The problems are (1) the log file is huge (2) rename is not atomic per
> your reply.

The important part of rename is atomic. If you have 'log_file', and then
you create 'log_file.new' and rename that to 'log_file', then there is
never an instant where 'log_file' does not exist; it goes directly from
pointing to one inode, to pointing to the other.

-- 
dwmw2





More information about the linux-mtd mailing list