[OpenAFS-devel] Avoid mixed use of Win32/CRTL in the servers

Rod Widdowson rdw@steadingsoftware.com
Tue, 18 Jan 2011 18:36:41 -0000


Mixing CRTL IO and Win32 is a recipe for disaster, and I have been looking at the servers with a view to reducing this.

Currently only namei_ops is Win32 aware. AFAICS, the rest of the file either use open or afs_open which is then mapped onto either
open or open64.

I'd like to take a couple of passes through "vol" trying to clear this up.

1) Redirect IO through the afs_XXXX operations.  
 a) remove all direct use of open and replace by afs_open, mapped appropriately
 b) change the use of "int fd" to be FD_t and comparison 'fd<0' or 'fd==-1' to be == INVALID_FD. 
 c) change direct use of read/write/whatever to be afs_read/afs_write/afs_whatever, mapped appropriately

In most cases the compiled code should be the same, although I guess that there will be some cases where previously we called open
and now we called open64.

2) Move individual modules over to using nt_XXXX rather than the CRTL homologs

At that stage I can start looking at the edge CRTL io functions (like mkdir()).

Thoughts?  Comments?  The only part of this which makes me at all nervous is the potential to call open64 where before we called
open.

/Rod