3 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
12 #define YFS_FS_SERVICE 2500
13 #define YFS_CM_SERVICE 2501
17 enum YFS_CM_Operations
{
18 YFSCBProbe
= 206, /* probe client */
19 YFSCBGetLock
= 207, /* get contents of CM lock table */
20 YFSCBXStatsVersion
= 209, /* get version of extended statistics */
21 YFSCBGetXStats
= 210, /* get contents of extended statistics data */
22 YFSCBInitCallBackState3
= 213, /* initialise callback state, version 3 */
23 YFSCBProbeUuid
= 214, /* check the client hasn't rebooted */
24 YFSCBGetServerPrefs
= 215,
25 YFSCBGetCellServDV
= 216,
26 YFSCBGetLocalCell
= 217,
27 YFSCBGetCacheConfig
= 218,
28 YFSCBGetCellByNum
= 65537,
29 YFSCBTellMeAboutYourself
= 65538, /* get client capabilities */
30 YFSCBCallBack
= 64204,
33 enum YFS_FS_Operations
{
34 YFSFETCHACL
= 64131, /* YFS Fetch file ACL */
35 YFSFETCHSTATUS
= 64132, /* YFS Fetch file status */
36 YFSSTOREACL
= 64134, /* YFS Store file ACL */
37 YFSSTORESTATUS
= 64135, /* YFS Store file status */
38 YFSREMOVEFILE
= 64136, /* YFS Remove a file */
39 YFSCREATEFILE
= 64137, /* YFS Create a file */
40 YFSRENAME
= 64138, /* YFS Rename or move a file or directory */
41 YFSSYMLINK
= 64139, /* YFS Create a symbolic link */
42 YFSLINK
= 64140, /* YFS Create a hard link */
43 YFSMAKEDIR
= 64141, /* YFS Create a directory */
44 YFSREMOVEDIR
= 64142, /* YFS Remove a directory */
45 YFSGETVOLUMESTATUS
= 64149, /* YFS Get volume status information */
46 YFSSETVOLUMESTATUS
= 64150, /* YFS Set volume status information */
47 YFSSETLOCK
= 64156, /* YFS Request a file lock */
48 YFSEXTENDLOCK
= 64157, /* YFS Extend a file lock */
49 YFSRELEASELOCK
= 64158, /* YFS Release a file lock */
50 YFSLOOKUP
= 64161, /* YFS lookup file in directory */
52 YFSFETCHOPAQUEACL
= 64168,
55 YFSREMOVEFILE2
= 64173,
56 YFSSTOREOPAQUEACL2
= 64174,
57 YFSINLINEBULKSTATUS
= 64536, /* YFS Fetch multiple file statuses with errors */
58 YFSFETCHDATA64
= 64537, /* YFS Fetch file data */
59 YFSSTOREDATA64
= 64538, /* YFS Store file data */
60 YFSUPDATESYMLINK
= 64540,
68 static inline u64
xdr_to_u64(const struct yfs_xdr_u64 x
)
70 return ((u64
)ntohl(x
.msw
) << 32) | ntohl(x
.lsw
);
73 static inline struct yfs_xdr_u64
u64_to_xdr(const u64 x
)
75 return (struct yfs_xdr_u64
){ .msw
= htonl(x
>> 32), .lsw
= htonl(x
) };
78 struct yfs_xdr_vnode
{
79 struct yfs_xdr_u64 lo
;
84 struct yfs_xdr_YFSFid
{
85 struct yfs_xdr_u64 volume
;
86 struct yfs_xdr_vnode vnode
;
90 struct yfs_xdr_YFSFetchStatus
{
93 struct yfs_xdr_u64 size
;
94 struct yfs_xdr_u64 data_version
;
95 struct yfs_xdr_u64 author
;
96 struct yfs_xdr_u64 owner
;
97 struct yfs_xdr_u64 group
;
101 struct yfs_xdr_vnode parent
;
102 __be32 data_access_protocol
;
103 struct yfs_xdr_u64 mtime_client
;
104 struct yfs_xdr_u64 mtime_server
;
109 struct yfs_xdr_YFSCallBack
{
111 struct yfs_xdr_u64 expiration_time
;
115 struct yfs_xdr_YFSStoreStatus
{
118 struct yfs_xdr_u64 mtime_client
;
119 struct yfs_xdr_u64 owner
;
120 struct yfs_xdr_u64 group
;
123 struct yfs_xdr_RPCFlags
{
127 struct yfs_xdr_YFSVolSync
{
128 struct yfs_xdr_u64 vol_creation_date
;
129 struct yfs_xdr_u64 vol_update_date
;
130 struct yfs_xdr_u64 max_quota
;
131 struct yfs_xdr_u64 blocks_in_use
;
132 struct yfs_xdr_u64 blocks_avail
;
135 enum yfs_volume_type
{
136 yfs_volume_type_ro
= 0,
137 yfs_volume_type_rw
= 1,
140 #define yfs_FVSOnline 0x1
141 #define yfs_FVSInservice 0x2
142 #define yfs_FVSBlessed 0x4
143 #define yfs_FVSNeedsSalvage 0x8
145 struct yfs_xdr_YFSFetchVolumeStatus
{
146 struct yfs_xdr_u64 vid
;
147 struct yfs_xdr_u64 parent_id
;
150 struct yfs_xdr_u64 max_quota
;
151 struct yfs_xdr_u64 blocks_in_use
;
152 struct yfs_xdr_u64 part_blocks_avail
;
153 struct yfs_xdr_u64 part_max_blocks
;
154 struct yfs_xdr_u64 vol_copy_date
;
155 struct yfs_xdr_u64 vol_backup_date
;
158 struct yfs_xdr_YFSStoreVolumeStatus
{
160 struct yfs_xdr_u64 min_quota
;
161 struct yfs_xdr_u64 max_quota
;
162 struct yfs_xdr_u64 file_quota
;
171 yfs_LockMandatoryRead
= 0x100,
172 yfs_LockMandatoryWrite
= 0x101,
173 yfs_LockMandatoryExtend
= 0x102,