diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index f59ef40d7d..01adda3d54 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -1203,7 +1203,7 @@ int SRXAFSCB_GetCellServDB( afs_PutCell(tcell, READ_LOCK); } - t_name = (char *)rxi_Alloc(i+1); + t_name = (char *)afs_osi_Alloc(i+1); if (t_name == NULL) { ReleaseReadLock(&afs_xcell); RX_AFS_GUNLOCK(); @@ -1276,7 +1276,7 @@ int SRXAFSCB_GetLocalCell( plen = strlen(p_name); else plen = 0; - t_name = (char *)rxi_Alloc(plen+1); + t_name = (char *)afs_osi_Alloc(plen+1); if (t_name == NULL) { ReleaseReadLock(&afs_xcell); RX_AFS_GUNLOCK(); @@ -1376,7 +1376,7 @@ int SRXAFSCB_GetCacheConfig( * Currently only support version 1 */ allocsize = sizeof(cm_initparams_v1); - t_config = (afs_uint32 *)rxi_Alloc(allocsize); + t_config = (afs_uint32 *)afs_osi_Alloc(allocsize); if (t_config == NULL) { RX_AFS_GUNLOCK(); return ENOMEM; diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 231c99e095..5e27432189 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -271,7 +271,7 @@ MALLOC_DECLARE(M_AFS); #endif /* AFS_SUN5_ENV */ #include "../rpc/types.h" -#include "../rpc/xdr.h" +#include "../rx/xdr.h" #ifdef AFS_AIX32_ENV # include "net/spl.h" @@ -366,7 +366,7 @@ MALLOC_DECLARE(M_AFS); #undef register #endif /* AFS_ALPHA_ENV */ -#include +#include #include #include diff --git a/src/fsint/afsaux.c b/src/fsint/afsaux.c index 32edb08bfa..aaf14a04df 100644 --- a/src/fsint/afsaux.c +++ b/src/fsint/afsaux.c @@ -28,7 +28,7 @@ RCSID("$Header$"); #else #include "../h/types.h" #include "../rpc/types.h" -#include "../rpc/xdr.h" +#include "../rx/xdr.h" #endif #if !defined(AFS_ALPHA_ENV) #ifndef XDR_GETINT32 @@ -38,9 +38,6 @@ RCSID("$Header$"); #define XDR_PUTINT32 XDR_PUTLONG #endif #endif -#ifndef AFS_LINUX22_ENV -#include "../rpc/auth.h" -#endif #endif /* defined(UKERNEL) */ #include "../afsint/afsint.h" #else /* KERNEL */ diff --git a/src/fsint/afsint.xg b/src/fsint/afsint.xg index 64a7444af2..bc95caca5c 100644 --- a/src/fsint/afsint.xg +++ b/src/fsint/afsint.xg @@ -45,7 +45,7 @@ typedef afs_int32 ViceDataType; %#define SymbolicLink 3 %#ifdef KERNEL -%#define xdr_array(a,b,c,d,e,f) xdr_arrayN(a,b,c,d,e,f) +%#define afs_xdr_array(a,b,c,d,e,f) afs_xdr_arrayN(a,b,c,d,e,f) %#endif struct BD { diff --git a/src/libafs/Makefile.common.in b/src/libafs/Makefile.common.in index 3ee55513f1..4378945e72 100644 --- a/src/libafs/Makefile.common.in +++ b/src/libafs/Makefile.common.in @@ -92,6 +92,8 @@ AFSAOBJS = \ afsaux.o \ Kvice.xdr.o \ xdr_arrayn.o \ + xdr_array.o \ + xdr_int64.o \ Kvice.cs.o \ fcrypt.o \ rx.o \ @@ -119,6 +121,7 @@ AFSAOBJS = \ rxkad_client.o \ rxkad_common.o \ xdr_afsuuid.o \ + xdr.o \ afs_uuid.o $(AFS_OS_OBJS) # These next two allow nfs and nonfs builds to occur in the same directory. @@ -308,6 +311,12 @@ afsaux.o: $(AFSINT)/afsaux.c $(CRULE1) xdr_arrayn.o: $(RX)/xdr_arrayn.c $(CRULE1) +xdr_array.o: $(RX)/xdr_array.c + $(CRULE1) +xdr_int64.o: $(RX)/xdr_int64.c + $(CRULE1) +xdr.o: $(RX)/xdr.c + $(CRULE1) Kvldbint.cs.o: $(AFSINT)/Kvldbint.cs.c $(CRULE1) Kvldbint.xdr.o: $(AFSINT)/Kvldbint.xdr.c diff --git a/src/rx/rx_kcommon.h b/src/rx/rx_kcommon.h index 3d3ed69b7d..c83c88f5b1 100644 --- a/src/rx/rx_kcommon.h +++ b/src/rx/rx_kcommon.h @@ -93,9 +93,7 @@ struct coda_inode_info {}; #include "../afs/afs_osi.h" #include "../rx/rx_kmutex.h" #include "../afs/lock.h" -#ifndef AFS_LINUX22_ENV -#include "../rpc/xdr.h" -#endif +#include "../rx/xdr.h" #include "../rx/rx.h" #include "../rx/rx_globals.h" #include "../afs/longc_procs.h" diff --git a/src/rx/xdr.c b/src/rx/xdr.c index 2aa70b9207..8ca8a4aec7 100644 --- a/src/rx/xdr.c +++ b/src/rx/xdr.c @@ -129,6 +129,49 @@ xdr_u_int(xdrs, up) return (FALSE); } +#else +/* + * XDR afs_int32 integers + * same as xdr_u_long - open coded to save a proc call! + */ +bool_t +xdr_int(xdrs, lp) + register XDR *xdrs; + int *lp; +{ + + if (xdrs->x_op == XDR_ENCODE) + return (XDR_PUTINT32(xdrs, (long *)lp)); + + if (xdrs->x_op == XDR_DECODE) + return (XDR_GETINT32(xdrs, (long *)lp)); + + if (xdrs->x_op == XDR_FREE) + return (TRUE); + + return (FALSE); +} + +/* + * XDR unsigned afs_int32 integers + * same as xdr_long - open coded to save a proc call! + */ +bool_t +xdr_u_int(xdrs, ulp) + register XDR *xdrs; + int *ulp; +{ + + if (xdrs->x_op == XDR_DECODE) + return (XDR_GETINT32(xdrs, (long *)ulp)); + if (xdrs->x_op == XDR_ENCODE) + return (XDR_PUTINT32(xdrs, (long *)ulp)); + if (xdrs->x_op == XDR_FREE) + return (TRUE); + return (FALSE); +} +#endif + /* * XDR afs_int32 integers @@ -173,48 +216,7 @@ xdr_u_long(xdrs, ulp) return (FALSE); } -#else -/* - * XDR afs_int32 integers - * same as xdr_u_long - open coded to save a proc call! - */ -bool_t -xdr_int(xdrs, lp) - register XDR *xdrs; - int *lp; -{ - if (xdrs->x_op == XDR_ENCODE) - return (XDR_PUTINT32(xdrs, (long *)lp)); - - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETINT32(xdrs, (long *)lp)); - - if (xdrs->x_op == XDR_FREE) - return (TRUE); - - return (FALSE); -} - -/* - * XDR unsigned afs_int32 integers - * same as xdr_long - open coded to save a proc call! - */ -bool_t -xdr_u_int(xdrs, ulp) - register XDR *xdrs; - int *ulp; -{ - - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETINT32(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_ENCODE) - return (XDR_PUTINT32(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_FREE) - return (TRUE); - return (FALSE); -} -#endif /* * XDR chars */ diff --git a/src/rx/xdr.h b/src/rx/xdr.h index c74a8f0f72..6869745098 100644 --- a/src/rx/xdr.h +++ b/src/rx/xdr.h @@ -65,6 +65,33 @@ void *afs_osi_Alloc(); #define osi_alloc afs_osi_Alloc #define osi_free afs_osi_Free + +#ifndef UKERNEL +#define xdr_void afs_xdr_void +#define xdr_int afs_xdr_int +#define xdr_u_int afs_xdr_u_int +#define xdr_short afs_xdr_short +#define xdr_u_short afs_xdr_u_short +#define xdr_long afs_xdr_long +#define xdr_u_long afs_xdr_u_long +#define xdr_char afs_xdr_char +#define xdr_u_char afs_xdr_u_char +#define xdr_bool afs_xdr_bool +#define xdr_enum afs_xdr_enum +#define xdr_array afs_xdr_array +#define xdr_arrayN afs_xdr_arrayN +#define xdr_bytes afs_xdr_bytes +#define xdr_opaque afs_xdr_opaque +#define xdr_string afs_xdr_string +#define xdr_union afs_xdr_union +#define xdr_float afs_xdr_float +#define xdr_double afs_xdr_double +#define xdr_reference afs_xdr_reference +#define xdr_wrapstring afs_xdr_wrapstring +#define xdr_vector afs_xdr_vector +#define xdr_int64 afs_xdr_int64 +#define xdr_uint64 afs_xdr_uint64 +#endif #endif #ifndef major /* ouch! */ #include diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c index d4942f7474..5ef8876b5b 100644 --- a/src/rx/xdr_rx.c +++ b/src/rx/xdr_rx.c @@ -45,7 +45,7 @@ RCSID("$Header$"); #define u_quad_t __u_quad_t #endif #endif -#include "../rpc/xdr.h" +#include "../rx/xdr.h" #include "../netinet/in.h" #else /* !UKERNEL */ #include "../afs/sysincludes.h" diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index 0b003b8af3..d1f450c372 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -436,14 +436,7 @@ c_output(infile, define, extend, outfile, append) f_print(fout, "#include \"../h/stat.h\"\n"); f_print(fout, "#include \"../netinet/in.h\"\n"); f_print(fout, "#include \"../h/time.h\"\n"); - f_print(fout, "#ifndef AFS_LINUX22_ENV\n"); - f_print(fout, "#include \"../rpc/types.h\"\n"); - f_print(fout, "#endif /* AFS_LINUX22_ENV */\n"); - f_print(fout, "#ifdef AFS_LINUX22_ENV\n"); f_print(fout, "#include \"../rx/xdr.h\"\n"); - f_print(fout, "#else /* AFS_LINUX22_ENV */\n"); - f_print(fout, "#include \"../rpc/xdr.h\"\n"); - f_print(fout, "#endif /* AFS_LINUX22_ENV */\n"); f_print(fout, "#include \"../afsint/rxgen_consts.h\"\n"); } else { f_print(fout, "#include \n"); @@ -570,13 +563,7 @@ h_output(infile, define, extend, outfile, append) f_print(fout, "#define u_quad_t __u_quad_t\n"); f_print(fout, "#endif\n"); f_print(fout, "#endif\n"); - f_print(fout, "#ifdef AFS_LINUX22_ENV\n"); f_print(fout, "#include \"../rx/xdr.h\"\n"); - f_print(fout, "#else /* AFS_LINUX22_ENV */\n"); - f_print(fout, "extern bool_t xdr_int64();\n"); - f_print(fout, "extern bool_t xdr_uint64();\n"); - f_print(fout, "#include \"../rpc/xdr.h\"\n"); - f_print(fout, "#endif /* AFS_LINUX22_ENV */\n"); f_print(fout, "#endif /* XDR_GETLONG */\n"); f_print(fout, "#endif /* UKERNEL */\n"); f_print(fout, "#include \"../afsint/rxgen_consts.h\"\n"); @@ -752,11 +739,7 @@ int append; f_print(fout, "#include \"../netinet/in.h\"\n"); f_print(fout, "#include \"../h/time.h\"\n"); f_print(fout, "#include \"../rpc/types.h\"\n"); - f_print(fout, "#ifdef AFS_LINUX22_ENV\n"); f_print(fout, "#include \"../rx/xdr.h\"\n"); - f_print(fout, "#else /* AFS_LINUX22_ENV */\n"); - f_print(fout, "#include \"../rpc/xdr.h\"\n"); - f_print(fout, "#endif /* AFS_LINUX22_ENV */\n"); f_print(fout, "#include \"../afsint/rxgen_consts.h\"\n"); f_print(fout, "#include \"../afs/afs_osi.h\"\n"); f_print(fout, "#include \"../rx/rx.h\"\n"); @@ -827,11 +810,7 @@ int append; f_print(fout, "#include \"../netinet/in.h\"\n"); f_print(fout, "#include \"../h/time.h\"\n"); f_print(fout, "#include \"../rpc/types.h\"\n"); - f_print(fout, "#ifdef AFS_LINUX22_ENV\n"); f_print(fout, "#include \"../rx/xdr.h\"\n"); - f_print(fout, "#else /* AFS_LINUX22_ENV */\n"); - f_print(fout, "#include \"../rpc/xdr.h\"\n"); - f_print(fout, "#endif /* AFS_LINUX22_ENV */\n"); f_print(fout, "#include \"../afsint/rxgen_consts.h\"\n"); f_print(fout, "#include \"../afs/afs_osi.h\"\n"); f_print(fout, "#include \"../rx/rx.h\"\n"); diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c index f12d5315c3..637ac769f0 100644 --- a/src/rxkad/rxkad_client.c +++ b/src/rxkad/rxkad_client.c @@ -34,7 +34,7 @@ RCSID("$Header$"); #endif /* !UKERNEL */ #ifndef AFS_LINUX22_ENV #include "../rpc/types.h" -#include "../rpc/xdr.h" +#include "../rx/xdr.h" #endif #include "../rx/rx.h" #else /* ! KERNEL */ diff --git a/src/rxkad/rxkad_common.c b/src/rxkad/rxkad_common.c index 96f404acce..7f7aab4b8c 100644 --- a/src/rxkad/rxkad_common.c +++ b/src/rxkad/rxkad_common.c @@ -29,7 +29,7 @@ RCSID("$Header$"); #include "../h/time.h" #ifndef AFS_LINUX22_ENV #include "../rpc/types.h" -#include "../rpc/xdr.h" +#include "../rx/xdr.h" #endif /* AFS_LINUX22_ENV */ #else /* !UKERNEL */ #include "../afs/sysincludes.h"