mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 14:07:39 +00:00
18fb735083
Code ifdef'd any of AFS_MACH_ENV, AFS_GFS_ENV, AFS_DEC_ENV dies Code ifdef'd AFS_SUN_ENV either becomes AFS_SUN5_ENV or dies as appropriate, in the kernel only. The database servers etc are probably still buildable, and I still have a SunOS 4.1.4 machine. ;-) But the Solaris vnops get all SunOS 4 code nuked. Uses of AFS_ALPHA_ENV which secretly meant OSF/1,D/UX,Tru64 become AFS_OSF_ENV. Bozon lock use gets its own ifdef. OSF and Solaris define it. Darwin and any BSDs have bozon lock usage removed: note that only OSF and Solaris were bothering to *init* the bozon lock during NewVCache. Bozon locks are for platforms where basically we could end up deadlocking ourselves because of how locks are handled. Some nonsensical ifdefs removed. Some if 0'd code removed. Some obsolete code (hpux pre-10, for instance) removed. (cherry picked from commit 706530c295dcf528d7307a524020457a0a6d5f59)
154 lines
3.1 KiB
C
154 lines
3.1 KiB
C
|
|
/*
|
|
* XDR routine for int64 (long long or struct)
|
|
*/
|
|
|
|
#include <afsconfig.h>
|
|
#include <afs/param.h>
|
|
|
|
RCSID
|
|
("$Header$");
|
|
|
|
#if defined(KERNEL) && !defined(UKERNEL)
|
|
#ifdef AFS_LINUX20_ENV
|
|
#include "h/string.h"
|
|
#else
|
|
#include <sys/param.h>
|
|
#include <sys/systm.h>
|
|
#endif
|
|
#else
|
|
#include <stdio.h>
|
|
#endif
|
|
#include "xdr.h"
|
|
|
|
#ifdef AFS_64BIT_ENV
|
|
/*
|
|
* XDR afs_int64 integers
|
|
*/
|
|
bool_t
|
|
xdr_int64(register XDR * xdrs, afs_int64 * ulp)
|
|
{
|
|
return xdr_afs_int64(xdrs, ulp);
|
|
}
|
|
|
|
bool_t
|
|
xdr_afs_int64(register XDR * xdrs, afs_int64 * ulp)
|
|
{
|
|
afs_int32 high;
|
|
afs_uint32 low;
|
|
|
|
if (xdrs->x_op == XDR_DECODE) {
|
|
if (!XDR_GETINT32(xdrs, (afs_int32 *) & high))
|
|
return (FALSE);
|
|
if (!XDR_GETINT32(xdrs, (afs_int32 *) & low))
|
|
return (FALSE);
|
|
*ulp = high;
|
|
*ulp <<= 32;
|
|
*ulp += low;
|
|
return (TRUE);
|
|
}
|
|
if (xdrs->x_op == XDR_ENCODE) {
|
|
high = (afs_int32) (*ulp >> 32);
|
|
low = (afs_uint32) (*ulp & 0xFFFFFFFFL);
|
|
if (!XDR_PUTINT32(xdrs, (afs_int32 *) & high))
|
|
return (FALSE);
|
|
return (XDR_PUTINT32(xdrs, (afs_int32 *) & low));
|
|
}
|
|
if (xdrs->x_op == XDR_FREE)
|
|
return (TRUE);
|
|
return (FALSE);
|
|
}
|
|
|
|
/*
|
|
* XDR afs_int64 integers
|
|
*/
|
|
bool_t
|
|
xdr_uint64(register XDR * xdrs, afs_uint64 * ulp)
|
|
{
|
|
return xdr_afs_uint64(xdrs, ulp);
|
|
}
|
|
|
|
bool_t
|
|
xdr_afs_uint64(register XDR * xdrs, afs_uint64 * ulp)
|
|
{
|
|
afs_uint32 high;
|
|
afs_uint32 low;
|
|
|
|
if (xdrs->x_op == XDR_DECODE) {
|
|
if (!XDR_GETINT32(xdrs, (afs_uint32 *) & high))
|
|
return (FALSE);
|
|
if (!XDR_GETINT32(xdrs, (afs_uint32 *) & low))
|
|
return (FALSE);
|
|
*ulp = high;
|
|
*ulp <<= 32;
|
|
*ulp += low;
|
|
return (TRUE);
|
|
}
|
|
if (xdrs->x_op == XDR_ENCODE) {
|
|
high = (afs_uint32) (*ulp >> 32);
|
|
low = (afs_uint32) (*ulp & 0xFFFFFFFFL);
|
|
if (!XDR_PUTINT32(xdrs, (afs_uint32 *) & high))
|
|
return (FALSE);
|
|
return (XDR_PUTINT32(xdrs, (afs_uint32 *) & low));
|
|
}
|
|
if (xdrs->x_op == XDR_FREE)
|
|
return (TRUE);
|
|
return (FALSE);
|
|
}
|
|
|
|
#else /* AFS_64BIT_ENV */
|
|
/*
|
|
* XDR afs_int64 integers
|
|
*/
|
|
bool_t
|
|
xdr_int64(register XDR * xdrs, afs_int64 * ulp)
|
|
{
|
|
return xdr_afs_int64(xdrs, ulp);
|
|
}
|
|
|
|
bool_t
|
|
xdr_afs_int64(register XDR * xdrs, afs_int64 * ulp)
|
|
{
|
|
if (xdrs->x_op == XDR_DECODE) {
|
|
if (!XDR_GETINT32(xdrs, (afs_int32 *) & ulp->high))
|
|
return (FALSE);
|
|
return (XDR_GETINT32(xdrs, (afs_int32 *) & ulp->low));
|
|
}
|
|
if (xdrs->x_op == XDR_ENCODE) {
|
|
if (!XDR_PUTINT32(xdrs, (afs_int32 *) & ulp->high))
|
|
return (FALSE);
|
|
return (XDR_PUTINT32(xdrs, (afs_int32 *) & ulp->low));
|
|
}
|
|
if (xdrs->x_op == XDR_FREE)
|
|
return (TRUE);
|
|
return (FALSE);
|
|
}
|
|
|
|
/*
|
|
* XDR afs_uint64 integers
|
|
*/
|
|
bool_t
|
|
xdr_uint64(register XDR * xdrs, afs_uint64 * ulp)
|
|
{
|
|
return xdr_afs_uint64(xdrs, ulp);
|
|
}
|
|
|
|
bool_t
|
|
xdr_afs_uint64(register XDR * xdrs, afs_uint64 * ulp)
|
|
{
|
|
if (xdrs->x_op == XDR_DECODE) {
|
|
if (!XDR_GETINT32(xdrs, (afs_uint32 *) & ulp->high))
|
|
return (FALSE);
|
|
return (XDR_GETINT32(xdrs, (afs_uint32 *) & ulp->low));
|
|
}
|
|
if (xdrs->x_op == XDR_ENCODE) {
|
|
if (!XDR_PUTINT32(xdrs, (afs_uint32 *) & ulp->high))
|
|
return (FALSE);
|
|
return (XDR_PUTINT32(xdrs, (afs_uint32 *) & ulp->low));
|
|
}
|
|
if (xdrs->x_op == XDR_FREE)
|
|
return (TRUE);
|
|
return (FALSE);
|
|
}
|
|
#endif /* AFS_64BIT_ENV */
|