[8412] in Info-AFS_Redistribution

home help back first fref pref prev next nref lref last post

Re: Cached write()s, save on close

daemon@ATHENA.MIT.EDU (Jeff Blaine)
Thu Jan 11 12:13:11 2001

Date: Thu, 11 Jan 2001 11:43:56 -0500
From: Jeff Blaine <jblaine@linus.mitre.org>
To: Hans Ranke <Hans.Ranke@ei.tum.de>
cc: info-afs@transarc.com, jfc@mit.edu
Message-ID: <4255860688.979213436@jblaine-pc.mitre.org>
In-Reply-To: <200101110938.KAA01403@regency.regent.e-technik.tu-muenchen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks.  The C code worked fine (as did yours, John Carr).  It never
dawned on me that it would be as simple as that.

>> We have a user who is not fond of cached write()s and save-on-close in
>> AFS for a particular file of his.  He also does not have the source
>> code to the tool which is appending to the file, so modifying it to
>> flush is not possible at that level.
>>
> Flush? I assume you mean fsync. (Fflush empties the stdio buffer, this
> is not related to AFS).
>
> You can do the fsync with a different program on the host that is writing
> to the file. I have appended a minimal C program and a little perl script.
> Both can be used for this purpose. If you want a continuous update,
> put these programs in a shell loop together with an appropriate sleep.
>
> Note: The perl script needs syscall.ph installed. This file can be created
> with the h2ph utility that comes with perl. If you have problems creating
> this file, you can remove the require line in the perl script and replace
> "&SYS_fsync" by the number of the fsync syscall on your OS (see
> /usr/include/syscall.h).
>
> Regards, Hans



home help back first fref pref prev next nref lref last post