patch-2.4.10 linux/include/linux/sunrpc/xdr.h

Next file: linux/include/linux/sunrpc/xprt.h
Previous file: linux/include/linux/soundcard.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/include/linux/sunrpc/xdr.h linux/include/linux/sunrpc/xdr.h
@@ -34,27 +34,27 @@
 typedef int	(*kxdrproc_t)(void *rqstp, u32 *data, void *obj);
 
 /*
- * These variables contain pre-xdr'ed values for faster operation.
- * FIXME: should be replaced by macros for big-endian machines.
+ * pre-xdr'ed macros.
  */
-extern u32	xdr_zero, xdr_one, xdr_two;
 
-extern u32	rpc_success,
-		rpc_prog_unavail,
-		rpc_prog_mismatch,
-		rpc_proc_unavail,
-		rpc_garbage_args,
-		rpc_system_err;
+#define	xdr_zero	__constant_htonl(0)
+#define	xdr_one		__constant_htonl(1)
+#define	xdr_two		__constant_htonl(2)
 
-extern u32	rpc_auth_ok,
-		rpc_autherr_badcred,
-		rpc_autherr_rejectedcred,
-		rpc_autherr_badverf,
-		rpc_autherr_rejectedverf,
-		rpc_autherr_tooweak,
-		rpc_autherr_dropit;
+#define	rpc_success		__constant_htonl(RPC_SUCCESS)
+#define	rpc_prog_unavail	__constant_htonl(RPC_PROG_UNAVAIL)
+#define	rpc_prog_mismatch	__constant_htonl(RPC_PROG_MISMATCH)
+#define	rpc_proc_unavail	__constant_htonl(RPC_PROC_UNAVAIL)
+#define	rpc_garbage_args	__constant_htonl(RPC_GARBAGE_ARGS)
+#define	rpc_system_err		__constant_htonl(RPC_SYSTEM_ERR)
+
+#define	rpc_auth_ok		__constant_htonl(RPC_AUTH_OK)
+#define	rpc_autherr_badcred	__constant_htonl(RPC_AUTH_BADCRED)
+#define	rpc_autherr_rejectedcred __constant_htonl(RPC_AUTH_REJECTEDCRED)
+#define	rpc_autherr_badverf	__constant_htonl(RPC_AUTH_BADVERF)
+#define	rpc_autherr_rejectedverf __constant_htonl(RPC_AUTH_REJECTEDVERF)
+#define	rpc_autherr_tooweak	__constant_htonl(RPC_AUTH_TOOWEAK)
 
-void		xdr_init(void);
 
 /*
  * Miscellaneous XDR helper functions
@@ -62,6 +62,7 @@
 u32 *	xdr_encode_array(u32 *p, const char *s, unsigned int len);
 u32 *	xdr_encode_string(u32 *p, const char *s);
 u32 *	xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
+u32 *	xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
 u32 *	xdr_decode_netobj(u32 *p, struct xdr_netobj *);
 u32 *	xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)