On Thu, 8 Aug 2002, Yee Man Chan wrote:
> Recently when I was hacking squid, I find a need to
> update the metadata. Then I come up with a thought
> that might allow us to update the revalidated
> metadata.
>
> The idea is to fix a certain amount of space in the
> beginning of a swap object for metadata.
>
> Here is a solution for UFS:
>
> 1. Remove O_APPEND from file_open
I'm no expert, but I think that APPEND has a major
impact on the semantics of write(). I think that
APPEND gives a certain atomicity guarantee that
might be important in the code you're reading.
On Solaris, "man -s 2 write" says
If the O_APPEND flag of the file status flags
is set, the file offset will be set to the end
of the file prior to each write and no
intervening file modification operation will
occur between changing the file offset and
the write operation.
This might be important to Squid. If you remove
APPEND, the danger is that two different threads
or processes might seek to different places and
then write; if these operations are interleaved
in unlucky ways, surprises happen. I think APPEND
guarantees that seek-to-end and write are atomic.
Received on Fri Aug 09 2002 - 00:40:13 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:01 MST