From b0747dde1b4463f851dc05fbd9755b175734c21c Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 7 Oct 2019 17:45:09 +0100 Subject: [PATCH] xg: Tidy up YFS definitions Signed-off-by: David Howells --- rpc-api/common.h | 3 ++ rpc-api/fs.xg | 1 - rpc-api/yfs.xg | 117 ++++++++++++++++++++++------------------------- 3 files changed, 57 insertions(+), 64 deletions(-) diff --git a/rpc-api/common.h b/rpc-api/common.h index cbafe36..4394c50 100644 --- a/rpc-api/common.h +++ b/rpc-api/common.h @@ -36,12 +36,14 @@ %#ifndef _COMMON_ %#define _COMMON_ +const LockNone = -1; const LockRead = 0; const LockWrite = 1; const LockExtend = 2; const LockRelease = 3; const AFSNAMEMAX = 256; +const AFSPATHMAX = 1024; const RWVOL = 0; const ROVOL = 1; @@ -73,6 +75,7 @@ enum CallBackType { }; const CALLBACK_VERSION = 1; +const FLUSHMAX = 10; struct AFSVolSync { uint32_t spare1; diff --git a/rpc-api/fs.xg b/rpc-api/fs.xg index 4f4c41c..b0f999f 100644 --- a/rpc-api/fs.xg +++ b/rpc-api/fs.xg @@ -39,7 +39,6 @@ package RXAFS_ #include "common.h" -const FLUSHMAX = 10; typedef int32_t ViceIds; typedef int32_t IPAddrs; diff --git a/rpc-api/yfs.xg b/rpc-api/yfs.xg index 7e7b954..fb21682 100644 --- a/rpc-api/yfs.xg +++ b/rpc-api/yfs.xg @@ -14,36 +14,31 @@ package RXYFS_ -RXYFS SERVICE ID = 2500 -RXAFSCB SERVICE ID = 2501 - -const LockNone = -1; -const LockRead = 0; -const LockWrite = 1; -const LockExtend = 2; -const LockRelease = 3; +const RXYFS_SERVICE_ID = 2500; +const RXAFSCB_SERVICE_ID = 2501; + const LockMandatoryRead = 0x100; const LockMandatoryWrite = 0x101; const LockMandatoryExtend = 0x102; const Mask_LockMandatory = 0x100; struct opr_time { - afs_int64 time; /* UNIX time in 100ns steps */ + int64_t time; /* UNIX time in 100ns steps */ }; -typedef afs_uint64 YFSSize; /* in bytes */ -typedef afs_uint64 YFSVolSize; /* in KiB */ -typedef afs_int64 YFSUserId; -typedef afs_uint64 YFSIndex; -typedef afs_uint64 YFSVolumeId; +typedef uint64_t YFSSize; /* in bytes */ +typedef uint64_t YFSVolSize; /* in KiB */ +typedef int64_t YFSUserId; +typedef uint64_t YFSIndex; +typedef uint64_t YFSVolumeId; typedef struct opr_time YFSRelTime64; typedef struct opr_time YFSAbsTime64; struct YFSVnode { - afs_uint64 lo; - afs_uint32 hi; - afs_uint32 uniq; + uint64_t lo; + uint32_t hi; + uint32_t uniq; }; struct YFSFid { @@ -52,9 +47,9 @@ struct YFSFid { }; struct YFSCallBack { - afs_uint32 CallBackVersion; + uint32_t CallBackVersion; YFSRelTime64 ExpirationTime; - afs_uint32 CallBackType; + uint32_t CallBackType; }; const YFSCBMAX = 1024; @@ -62,27 +57,27 @@ typedef YFSFid YFSCBFids; typedef YFSCallBack YFSCBs; struct YFSFetchStatus { - afs_uint32 FileType; /* AFSFileType */ - afs_uint32 LinkCount; + uint32_t FileType; /* AFSFileType */ + uint32_t LinkCount; YFSSize Length; /* all YFSSize's are in bytes */ - afs_uint64 DataVersion; + uint64_t DataVersion; YFSUserId Author; YFSUserId Owner; YFSUserId Group; - afs_uint32 UnixModeBits; - afs_uint32 CallerAccess; - afs_uint32 AnonymousAccess; + uint32_t UnixModeBits; + uint32_t CallerAccess; + uint32_t AnonymousAccess; YFSVnode ParentVnode; - afs_uint32 DataAccessProtocol; + uint32_t DataAccessProtocol; YFSAbsTime64 ClientModTime; YFSAbsTime64 ServerModTime; - afs_uint32 lockCount; - afs_uint32 errorCode; + uint32_t lockCount; + uint32_t errorCode; }; struct YFSStoreStatus { - afs_uint32 Mask; - afs_uint32 UnixModeBits; + uint32_t Mask; + uint32_t UnixModeBits; YFSAbsTime64 ClientModTime; YFSUserId Owner; YFSUserId Group; @@ -107,8 +102,8 @@ const AFSVolumeType_ReadWrite = 1; struct YFSFetchVolumeStatus { YFSVolumeId Vid; YFSVolumeId ParentId; - afs_uint32 flags; /* includes Online, Inservice, Blessed, NeedsSalvage */ - afs_int32 Type; /* AFSVolumeType */ + uint32_t flags; /* includes Online, Inservice, Blessed, NeedsSalvage */ + int32_t Type; /* AFSVolumeType */ YFSVolSize MaxQuota; /* all AFSVolSize's are in KiB */ YFSVolSize BlocksInUse; YFSVolSize PartBlocksAvail; @@ -118,7 +113,7 @@ struct YFSFetchVolumeStatus { }; struct YFSStoreVolumeStatus { - afs_int32 Mask; + int32_t Mask; YFSVolSize MinQuota; YFSVolSize MaxQuota; YFSVolSize FileQuota; @@ -126,14 +121,12 @@ struct YFSStoreVolumeStatus { typedef YFSFetchStatus YFSBulkStats; -const FLUSHMAX = 10; - -typedef afs_int64 YFSViceIds; +typedef int64_t YFSViceIds; const AUTHDATAMAX = 1024; const AUTHPRINTABLEMAX = 1024; struct FS_AuthName { - afs_int32 kind; + int32_t kind; opaque data; opaque display; }; @@ -148,18 +141,10 @@ RXYFS_GetCapabilities( OUT Capabilities *capabilities ) multi = 65540; -typedef afs_uint32 RPCFlags; +typedef uint32_t RPCFlags; /* RPC Flags */ const RPC_FLAG_NOCALLBACK = 0x0001; -const LockNone = -1; -const LockRead = 0; -const LockWrite = 1; -const LockMandatoryRead = 0x100; -const LockMandatoryWrite = 0x101; -const Mask_LockMandatory = 0x100; - - RXYFS_StoreData64( IN RPCFlags Flags, IN YFSFid *Fid, @@ -177,7 +162,7 @@ RXYFS_FetchACL( IN YFSFid *Fid, OUT AFSOpaque *AccessList, OUT AFSOpaque *VolAccessList, - OUT afs_int32 *InheritFlag, + OUT int32_t *InheritFlag, OUT YFSFetchStatus *OutStatus, OUT YFSVolSync *Sync ) = 64131; @@ -369,6 +354,12 @@ RXYFS_UpdateSymlink( /* 64163 was older revision of RemoveACL */ +#define ENDPOINT_IPV4 0 +#define ENDPOINT_IPV6 1 +struct endpoint { + uint32_t Type; + opaque Data; +}; typedef endpoint eplist; /* 64164 was an older revision of WhoAmI */ @@ -393,8 +384,8 @@ RXYFS_FetchOpaqueACL( IN YFSFid *Fid, OUT YFSOpaqueACL *AclXdr, OUT YFSOpaqueACL *VolAclXdr, - OUT afs_int32 *InheritFlag, - OUT afs_int32 *NumCleaned, + OUT int32_t *InheritFlag, + OUT int32_t *NumCleaned, OUT YFSFetchStatus *OutStatus, OUT YFSVolSync *Sync ) = 64168; @@ -442,19 +433,19 @@ RXYFSCB_Probe( ) multi = 206; RXYFSCB_GetLock( - IN afs_int32 index, + IN int32_t index, OUT AFSDBLock *lock ) = 207; RXYFSCB_XStatsVersion( - OUT afs_int32 *versionNumberP + OUT int32_t *versionNumberP ) = 209; RXYFSCB_GetXStats( - IN afs_int32 clientVersionNumber, - IN afs_int32 collectionNumber, - OUT afs_int32 *srvVersionNumberP, - OUT afs_int32 *timeP, + IN int32_t clientVersionNumber, + IN int32_t collectionNumber, + OUT int32_t *srvVersionNumberP, + OUT int32_t *timeP, OUT AFSCB_CollData *dataP ) = 210; @@ -467,13 +458,13 @@ RXYFSCB_ProbeUuid( ) multi = 214; RXYFSCB_GetServerPrefs( - IN afs_int32 serverIndex, - OUT afs_int32 *srvrAddr, - OUT afs_int32 *srvrRank + IN int32_t serverIndex, + OUT int32_t *srvrAddr, + OUT int32_t *srvrRank ) = 215; RXYFSCB_GetCellServDB( - IN afs_int32 cellIndex, + IN int32_t cellIndex, OUT string cellName, OUT serverList *cellHosts ) = 216; @@ -483,14 +474,14 @@ RXYFSCB_GetLocalCell( ) = 217; RXYFSCB_GetCacheConfig( - IN afs_uint32 callerVersion, - OUT afs_uint32 *serverVersion, - OUT afs_uint32 *configCount, + IN uint32_t callerVersion, + OUT uint32_t *serverVersion, + OUT uint32_t *configCount, OUT cacheConfig *config ) = 218; RXYFSCB_GetCellByNum( - IN afs_int32 cellNumber, + IN int32_t cellNumber, OUT string cellName, OUT serverList *cellHosts ) = 65537; -- 2.50.1