From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf van der Spek Subject: Re: Atomic file data replace API Date: Fri, 7 Jan 2011 17:34:52 +0100 Message-ID: References: <1294412141-sup-1734@think> <1294412553-sup-9058@think> <1294412980-sup-1924@think> <4D274022.5070507@mmmm.it> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: linux-btrfs To: Massimo Maggi Return-path: In-Reply-To: <4D274022.5070507@mmmm.it> List-ID: On Fri, Jan 7, 2011 at 5:32 PM, Massimo Maggi wrote: > Are you suggesting to do: > 1)fopen with O_TRUNC, O_ATOMIC: returns fd to a temporary file > 2)application writes to that fd, with one or more system calls, in a > short time or in long time, at his will. > 3)at fclose (or even at fsync ) atomically swap "data pointer" of "re= al > file" with "temp file", then delete temp.In a transparent mode to > userland. =C2=A0(something similar to e4defrag). > Is this sum up correct? Almost. Swap should probably not be done at fsync time. Other open references (for example running executables) should be swapp= ed too. The new-file case has to be handled too. Olaf -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html