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

Derrick Brashear shadow@gmail.com
Tue, 18 Jan 2011 14:04:54 -0500


On Tue, Jan 18, 2011 at 1:36 PM, Rod Widdowson <rdw@steadingsoftware.com> w=
rote:
> Mixing CRTL IO and Win32 is a recipe for disaster, and I have been lookin=
g at the servers with a view to reducing this.
>
> Currently only namei_ops is Win32 aware. AFAICS, the rest of the file eit=
her 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.
> =A0a) remove all direct use of open and replace by afs_open, mapped appro=
priately
> =A0b) change the use of "int fd" to be FD_t and comparison 'fd<0' or 'fd=
=3D=3D-1' to be =3D=3D INVALID_FD.
> =A0c) change direct use of read/write/whatever to be afs_read/afs_write/a=
fs_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.

the real "issue" will be making sure we make performance no worse than
before on unix. but that's easily accomplished by macroizing or
inlining as appropriate.

> 2) Move individual modules over to using nt_XXXX rather than the CRTL hom=
ologs
>
> At that stage I can start looking at the edge CRTL io functions (like mkd=
ir()).
>
> Thoughts? =A0Comments? =A0The only part of this which makes me at all ner=
vous is the potential to call open64 where before we called
> open.

some of those may well be "wrong" (using open, not open64 that is)

--=20
Derrick