at master 5.1 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* YFS protocol bits 3 * 4 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved. 5 * Written by David Howells (dhowells@redhat.com) 6 */ 7 8#define YFS_FS_SERVICE 2500 9#define YFS_CM_SERVICE 2501 10 11#define YFSCBMAX 1024 12 13enum YFS_CM_Operations { 14 YFSCBProbe = 206, /* probe client */ 15 YFSCBGetLock = 207, /* get contents of CM lock table */ 16 YFSCBXStatsVersion = 209, /* get version of extended statistics */ 17 YFSCBGetXStats = 210, /* get contents of extended statistics data */ 18 YFSCBInitCallBackState3 = 213, /* initialise callback state, version 3 */ 19 YFSCBProbeUuid = 214, /* check the client hasn't rebooted */ 20 YFSCBGetServerPrefs = 215, 21 YFSCBGetCellServDV = 216, 22 YFSCBGetLocalCell = 217, 23 YFSCBGetCacheConfig = 218, 24 YFSCBGetCellByNum = 65537, 25 YFSCBTellMeAboutYourself = 65538, /* get client capabilities */ 26 YFSCBCallBack = 64204, 27}; 28 29enum YFS_FS_Operations { 30 YFSFETCHACL = 64131, /* YFS Fetch file AFS3 ACL */ 31 YFSFETCHSTATUS = 64132, /* YFS Fetch file status */ 32 YFSSTOREACL = 64134, /* YFS Store file AFS3 ACL */ 33 YFSSTORESTATUS = 64135, /* YFS Store file status */ 34 YFSREMOVEFILE = 64136, /* YFS Remove a file */ 35 YFSCREATEFILE = 64137, /* YFS Create a file */ 36 YFSRENAME = 64138, /* YFS Rename or move a file or directory */ 37 YFSSYMLINK = 64139, /* YFS Create a symbolic link */ 38 YFSLINK = 64140, /* YFS Create a hard link */ 39 YFSMAKEDIR = 64141, /* YFS Create a directory */ 40 YFSREMOVEDIR = 64142, /* YFS Remove a directory */ 41 YFSGETVOLUMESTATUS = 64149, /* YFS Get volume status information */ 42 YFSSETVOLUMESTATUS = 64150, /* YFS Set volume status information */ 43 YFSSETLOCK = 64156, /* YFS Request a file lock */ 44 YFSEXTENDLOCK = 64157, /* YFS Extend a file lock */ 45 YFSRELEASELOCK = 64158, /* YFS Release a file lock */ 46 YFSLOOKUP = 64161, /* YFS lookup file in directory */ 47 YFSFLUSHCPS = 64165, 48 YFSFETCHOPAQUEACL = 64168, /* YFS Fetch file YFS ACL */ 49 YFSWHOAMI = 64170, 50 YFSREMOVEACL = 64171, 51 YFSREMOVEFILE2 = 64173, 52 YFSSTOREOPAQUEACL2 = 64174, 53 YFSRENAME_REPLACE = 64176, 54 YFSRENAME_NOREPLACE = 64177, 55 YFSRENAME_EXCHANGE = 64187, 56 YFSINLINEBULKSTATUS = 64536, /* YFS Fetch multiple file statuses with errors */ 57 YFSFETCHDATA64 = 64537, /* YFS Fetch file data */ 58 YFSSTOREDATA64 = 64538, /* YFS Store file data */ 59 YFSUPDATESYMLINK = 64540, 60}; 61 62struct yfs_xdr_u64 { 63 __be32 msw; 64 __be32 lsw; 65} __packed; 66 67static inline u64 xdr_to_u64(const struct yfs_xdr_u64 x) 68{ 69 return ((u64)ntohl(x.msw) << 32) | ntohl(x.lsw); 70} 71 72static inline struct yfs_xdr_u64 u64_to_xdr(const u64 x) 73{ 74 return (struct yfs_xdr_u64){ .msw = htonl(x >> 32), .lsw = htonl(x) }; 75} 76 77struct yfs_xdr_vnode { 78 struct yfs_xdr_u64 lo; 79 __be32 hi; 80 __be32 unique; 81} __packed; 82 83struct yfs_xdr_YFSFid { 84 struct yfs_xdr_u64 volume; 85 struct yfs_xdr_vnode vnode; 86} __packed; 87 88 89struct yfs_xdr_YFSFetchStatus { 90 __be32 type; 91 __be32 nlink; 92 struct yfs_xdr_u64 size; 93 struct yfs_xdr_u64 data_version; 94 struct yfs_xdr_u64 author; 95 struct yfs_xdr_u64 owner; 96 struct yfs_xdr_u64 group; 97 __be32 mode; 98 __be32 caller_access; 99 __be32 anon_access; 100 struct yfs_xdr_vnode parent; 101 __be32 data_access_protocol; 102 struct yfs_xdr_u64 mtime_client; 103 struct yfs_xdr_u64 mtime_server; 104 __be32 lock_count; 105 __be32 abort_code; 106} __packed; 107 108struct yfs_xdr_YFSCallBack { 109 __be32 version; 110 struct yfs_xdr_u64 expiration_time; 111 __be32 type; 112} __packed; 113 114struct yfs_xdr_YFSStoreStatus { 115 __be32 mask; 116 __be32 mode; 117 struct yfs_xdr_u64 mtime_client; 118 struct yfs_xdr_u64 owner; 119 struct yfs_xdr_u64 group; 120} __packed; 121 122struct yfs_xdr_RPCFlags { 123 __be32 rpc_flags; 124} __packed; 125 126struct yfs_xdr_YFSVolSync { 127 struct yfs_xdr_u64 vol_creation_date; 128 struct yfs_xdr_u64 vol_update_date; 129 struct yfs_xdr_u64 max_quota; 130 struct yfs_xdr_u64 blocks_in_use; 131 struct yfs_xdr_u64 blocks_avail; 132} __packed; 133 134enum yfs_volume_type { 135 yfs_volume_type_ro = 0, 136 yfs_volume_type_rw = 1, 137}; 138 139#define yfs_FVSOnline 0x1 140#define yfs_FVSInservice 0x2 141#define yfs_FVSBlessed 0x4 142#define yfs_FVSNeedsSalvage 0x8 143 144struct yfs_xdr_YFSFetchVolumeStatus { 145 struct yfs_xdr_u64 vid; 146 struct yfs_xdr_u64 parent_id; 147 __be32 flags; 148 __be32 type; 149 struct yfs_xdr_u64 max_quota; 150 struct yfs_xdr_u64 blocks_in_use; 151 struct yfs_xdr_u64 part_blocks_avail; 152 struct yfs_xdr_u64 part_max_blocks; 153 struct yfs_xdr_u64 vol_copy_date; 154 struct yfs_xdr_u64 vol_backup_date; 155} __packed; 156 157struct yfs_xdr_YFSStoreVolumeStatus { 158 __be32 mask; 159 struct yfs_xdr_u64 min_quota; 160 struct yfs_xdr_u64 max_quota; 161 struct yfs_xdr_u64 file_quota; 162} __packed; 163 164enum yfs_lock_type { 165 yfs_LockNone = -1, 166 yfs_LockRead = 0, 167 yfs_LockWrite = 1, 168 yfs_LockExtend = 2, 169 yfs_LockRelease = 3, 170 yfs_LockMandatoryRead = 0x100, 171 yfs_LockMandatoryWrite = 0x101, 172 yfs_LockMandatoryExtend = 0x102, 173}; 174 175/* RXYFS Viced Capability Flags */ 176#define YFS_VICED_CAPABILITY_ERRORTRANS 0x0001 /* Deprecated v0.195 */ 177#define YFS_VICED_CAPABILITY_64BITFILES 0x0002 /* Deprecated v0.195 */ 178#define YFS_VICED_CAPABILITY_WRITELOCKACL 0x0004 /* Can lock a file even without lock perm */ 179#define YFS_VICED_CAPABILITY_SANEACLS 0x0008 /* Deprecated v0.195 */