xg: Tidy up YFS definitions
authorDavid Howells <dhowells@redhat.com>
Mon, 7 Oct 2019 16:45:09 +0000 (17:45 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 30 Jun 2020 17:25:47 +0000 (18:25 +0100)
Signed-off-by: David Howells <dhowells@redhat.com>
rpc-api/common.h
rpc-api/fs.xg
rpc-api/yfs.xg

index cbafe3605bc818e80ac1c9af30d1ba8177710aaf..4394c5061f04ebbdfea9e7ee41c8cba5849db3a5 100644 (file)
 %#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;
index 4f4c41c75b4ec72337fc8db5bbf75d5162462d73..b0f999f6115bf2ce3c2e98c7c1be604dea10951f 100644 (file)
@@ -39,7 +39,6 @@ package RXAFS_
 
 #include "common.h"
 
-const FLUSHMAX = 10;
 typedef int32_t ViceIds<FLUSHMAX>;
 typedef int32_t IPAddrs<FLUSHMAX>;
 
index 7e7b954787915c1834779674ba9984604afcb35a..fb2168230a1718292490d2f636a64c5c5e3befcc 100644 (file)
 
 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<YFSCBMAX>;
 typedef YFSCallBack YFSCBs<YFSCBMAX>;
 
 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<YFSCBMAX>;
 
-const FLUSHMAX = 10;
-
-typedef afs_int64 YFSViceIds<FLUSHMAX>;
+typedef int64_t YFSViceIds<FLUSHMAX>;
 
 const AUTHDATAMAX = 1024;
 const AUTHPRINTABLEMAX = 1024;
 struct FS_AuthName {
-       afs_int32       kind;
+       int32_t         kind;
        opaque          data<AUTHDATAMAX>;
        opaque          display<AUTHPRINTABLEMAX>;
 };
@@ -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<FLUSHMAX>;
 
 /* 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<AFSNAMEMAX>,
        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<AFSNAMEMAX>,
        OUT serverList *cellHosts
 ) = 65537;