[OpenAFS] open() with O_EXCL in AFS

Jeffrey Hutzelman jhutz@cmu.edu
Fri, 12 Sep 2003 17:25:24 -0400


On Friday, September 12, 2003 13:37:02 -0500 "Neulinger, Nathan" 
<nneul@umr.edu> wrote:

> But does it support it on the local node only, or correctly across
> multiple cache managers?

The latter.  If you open a file with O_CREAT|O_EXCL, the cache manager will 
first do a directory lookup to see if the file exists, and return EEXIST if 
it does.  It will then attempt to create the file on the fileserver, using 
the RXAFS_CreateFile RPC.  The directory lookup-and-create operation is 
atomic and isolated, and fails if the requested name is already in use, so 
two simultaneous RXAFS_CreateFile operations on the same filename in the 
same directory cannot both succeed.