*BSD News Article 34635


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!agate!library.ucla.edu!psgrain!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (Terry Lambert)
Newsgroups: comp.unix.bsd
Subject: Re: Write-Through the File System Cache?
Date: 20 Aug 1994 08:30:37 GMT
Organization: Weber State University, Ogden, UT
Lines: 30
Message-ID: <334evd$mgn@u.cc.utah.edu>
References: <3305rj$14k@hopper.acm.org>
NNTP-Posting-Host: cs.weber.edu

In article <3305rj$14k@hopper.acm.org> ian_vogt@ACM.ORG writes:
] 
] re: BSDI (but also for others in the *BSD* family)
] 
] I would like to know if it is possible (without modifying
] the kernel) for an application to disable delayed write
] caching (or enable write-through caching) either for the
] file system as a whole or for a particular file (or file
] handle).
] 
] I develop fault tolerant applications requiring that
] critical file updates be committed to disk before returning
] from the write call (for recovery purposes).

This behaviour is already guaranteed by UFS for metadata; for non-metadata,
you should use the O_WRITESYNC flag when opening (there is, I believe, a
bug in dir.c where an async write should be a sync write in NetBSD and
FreeBSD).

If you can guarantee atomicity of request ordering from user space (ie:
a single user space consumer for the interface for your engine), then
you might also be able to use fsync(2).


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.