1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
8 #define YFS_FS_SERVICE 2500
9 #define YFS_CM_SERVICE 2501
13 enum 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,
29 enum 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 */
48 YFSFETCHOPAQUEACL
= 64168, /* YFS Fetch file YFS ACL */
51 YFSREMOVEFILE2
= 64173,
52 YFSSTOREOPAQUEACL2
= 64174,
53 YFSINLINEBULKSTATUS
= 64536, /* YFS Fetch multiple file statuses with errors */
54 YFSFETCHDATA64
= 64537, /* YFS Fetch file data */
55 YFSSTOREDATA64
= 64538, /* YFS Store file data */
56 YFSUPDATESYMLINK
= 64540,
64 static inline u64
xdr_to_u64(const struct yfs_xdr_u64 x
)
66 return ((u64
)ntohl(x
.msw
) << 32) | ntohl(x
.lsw
);
69 static inline struct yfs_xdr_u64
u64_to_xdr(const u64 x
)
71 return (struct yfs_xdr_u64
){ .msw
= htonl(x
>> 32), .lsw
= htonl(x
) };
74 struct yfs_xdr_vnode
{
75 struct yfs_xdr_u64 lo
;
80 struct yfs_xdr_YFSFid
{
81 struct yfs_xdr_u64 volume
;
82 struct yfs_xdr_vnode vnode
;
86 struct yfs_xdr_YFSFetchStatus
{
89 struct yfs_xdr_u64 size
;
90 struct yfs_xdr_u64 data_version
;
91 struct yfs_xdr_u64 author
;
92 struct yfs_xdr_u64 owner
;
93 struct yfs_xdr_u64 group
;
97 struct yfs_xdr_vnode parent
;
98 __be32 data_access_protocol
;
99 struct yfs_xdr_u64 mtime_client
;
100 struct yfs_xdr_u64 mtime_server
;
105 struct yfs_xdr_YFSCallBack
{
107 struct yfs_xdr_u64 expiration_time
;
111 struct yfs_xdr_YFSStoreStatus
{
114 struct yfs_xdr_u64 mtime_client
;
115 struct yfs_xdr_u64 owner
;
116 struct yfs_xdr_u64 group
;
119 struct yfs_xdr_RPCFlags
{
123 struct yfs_xdr_YFSVolSync
{
124 struct yfs_xdr_u64 vol_creation_date
;
125 struct yfs_xdr_u64 vol_update_date
;
126 struct yfs_xdr_u64 max_quota
;
127 struct yfs_xdr_u64 blocks_in_use
;
128 struct yfs_xdr_u64 blocks_avail
;
131 enum yfs_volume_type
{
132 yfs_volume_type_ro
= 0,
133 yfs_volume_type_rw
= 1,
136 #define yfs_FVSOnline 0x1
137 #define yfs_FVSInservice 0x2
138 #define yfs_FVSBlessed 0x4
139 #define yfs_FVSNeedsSalvage 0x8
141 struct yfs_xdr_YFSFetchVolumeStatus
{
142 struct yfs_xdr_u64 vid
;
143 struct yfs_xdr_u64 parent_id
;
146 struct yfs_xdr_u64 max_quota
;
147 struct yfs_xdr_u64 blocks_in_use
;
148 struct yfs_xdr_u64 part_blocks_avail
;
149 struct yfs_xdr_u64 part_max_blocks
;
150 struct yfs_xdr_u64 vol_copy_date
;
151 struct yfs_xdr_u64 vol_backup_date
;
154 struct yfs_xdr_YFSStoreVolumeStatus
{
156 struct yfs_xdr_u64 min_quota
;
157 struct yfs_xdr_u64 max_quota
;
158 struct yfs_xdr_u64 file_quota
;
167 yfs_LockMandatoryRead
= 0x100,
168 yfs_LockMandatoryWrite
= 0x101,
169 yfs_LockMandatoryExtend
= 0x102,
172 /* RXYFS Viced Capability Flags */
173 #define YFS_VICED_CAPABILITY_ERRORTRANS 0x0001 /* Deprecated v0.195 */
174 #define YFS_VICED_CAPABILITY_64BITFILES 0x0002 /* Deprecated v0.195 */
175 #define YFS_VICED_CAPABILITY_WRITELOCKACL 0x0004 /* Can lock a file even without lock perm */
176 #define YFS_VICED_CAPABILITY_SANEACLS 0x0008 /* Deprecated v0.195 */