Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* YFS protocol bits
0003  *
0004  * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 
0008 #define YFS_FS_SERVICE  2500
0009 #define YFS_CM_SERVICE  2501
0010 
0011 #define YFSCBMAX    1024
0012 
0013 enum YFS_CM_Operations {
0014     YFSCBProbe      = 206,  /* probe client */
0015     YFSCBGetLock        = 207,  /* get contents of CM lock table */
0016     YFSCBXStatsVersion  = 209,  /* get version of extended statistics */
0017     YFSCBGetXStats      = 210,  /* get contents of extended statistics data */
0018     YFSCBInitCallBackState3 = 213,  /* initialise callback state, version 3 */
0019     YFSCBProbeUuid      = 214,  /* check the client hasn't rebooted */
0020     YFSCBGetServerPrefs = 215,
0021     YFSCBGetCellServDV  = 216,
0022     YFSCBGetLocalCell   = 217,
0023     YFSCBGetCacheConfig = 218,
0024     YFSCBGetCellByNum   = 65537,
0025     YFSCBTellMeAboutYourself = 65538, /* get client capabilities */
0026     YFSCBCallBack       = 64204,
0027 };
0028 
0029 enum YFS_FS_Operations {
0030     YFSFETCHACL     = 64131, /* YFS Fetch file AFS3 ACL */
0031     YFSFETCHSTATUS      = 64132, /* YFS Fetch file status */
0032     YFSSTOREACL     = 64134, /* YFS Store file AFS3 ACL */
0033     YFSSTORESTATUS      = 64135, /* YFS Store file status */
0034     YFSREMOVEFILE       = 64136, /* YFS Remove a file */
0035     YFSCREATEFILE       = 64137, /* YFS Create a file */
0036     YFSRENAME       = 64138, /* YFS Rename or move a file or directory */
0037     YFSSYMLINK      = 64139, /* YFS Create a symbolic link */
0038     YFSLINK         = 64140, /* YFS Create a hard link */
0039     YFSMAKEDIR      = 64141, /* YFS Create a directory */
0040     YFSREMOVEDIR        = 64142, /* YFS Remove a directory */
0041     YFSGETVOLUMESTATUS  = 64149, /* YFS Get volume status information */
0042     YFSSETVOLUMESTATUS  = 64150, /* YFS Set volume status information */
0043     YFSSETLOCK      = 64156, /* YFS Request a file lock */
0044     YFSEXTENDLOCK       = 64157, /* YFS Extend a file lock */
0045     YFSRELEASELOCK      = 64158, /* YFS Release a file lock */
0046     YFSLOOKUP       = 64161, /* YFS lookup file in directory */
0047     YFSFLUSHCPS     = 64165,
0048     YFSFETCHOPAQUEACL   = 64168, /* YFS Fetch file YFS ACL */
0049     YFSWHOAMI       = 64170,
0050     YFSREMOVEACL        = 64171,
0051     YFSREMOVEFILE2      = 64173,
0052     YFSSTOREOPAQUEACL2  = 64174,
0053     YFSINLINEBULKSTATUS = 64536, /* YFS Fetch multiple file statuses with errors */
0054     YFSFETCHDATA64      = 64537, /* YFS Fetch file data */
0055     YFSSTOREDATA64      = 64538, /* YFS Store file data */
0056     YFSUPDATESYMLINK    = 64540,
0057 };
0058 
0059 struct yfs_xdr_u64 {
0060     __be32          msw;
0061     __be32          lsw;
0062 } __packed;
0063 
0064 static inline u64 xdr_to_u64(const struct yfs_xdr_u64 x)
0065 {
0066     return ((u64)ntohl(x.msw) << 32) | ntohl(x.lsw);
0067 }
0068 
0069 static inline struct yfs_xdr_u64 u64_to_xdr(const u64 x)
0070 {
0071     return (struct yfs_xdr_u64){ .msw = htonl(x >> 32), .lsw = htonl(x) };
0072 }
0073 
0074 struct yfs_xdr_vnode {
0075     struct yfs_xdr_u64  lo;
0076     __be32          hi;
0077     __be32          unique;
0078 } __packed;
0079 
0080 struct yfs_xdr_YFSFid {
0081     struct yfs_xdr_u64  volume;
0082     struct yfs_xdr_vnode    vnode;
0083 } __packed;
0084 
0085 
0086 struct yfs_xdr_YFSFetchStatus {
0087     __be32          type;
0088     __be32          nlink;
0089     struct yfs_xdr_u64  size;
0090     struct yfs_xdr_u64  data_version;
0091     struct yfs_xdr_u64  author;
0092     struct yfs_xdr_u64  owner;
0093     struct yfs_xdr_u64  group;
0094     __be32          mode;
0095     __be32          caller_access;
0096     __be32          anon_access;
0097     struct yfs_xdr_vnode    parent;
0098     __be32          data_access_protocol;
0099     struct yfs_xdr_u64  mtime_client;
0100     struct yfs_xdr_u64  mtime_server;
0101     __be32          lock_count;
0102     __be32          abort_code;
0103 } __packed;
0104 
0105 struct yfs_xdr_YFSCallBack {
0106     __be32          version;
0107     struct yfs_xdr_u64  expiration_time;
0108     __be32          type;
0109 } __packed;
0110 
0111 struct yfs_xdr_YFSStoreStatus {
0112     __be32          mask;
0113     __be32          mode;
0114     struct yfs_xdr_u64  mtime_client;
0115     struct yfs_xdr_u64  owner;
0116     struct yfs_xdr_u64  group;
0117 } __packed;
0118 
0119 struct yfs_xdr_RPCFlags {
0120     __be32          rpc_flags;
0121 } __packed;
0122 
0123 struct yfs_xdr_YFSVolSync {
0124     struct yfs_xdr_u64  vol_creation_date;
0125     struct yfs_xdr_u64  vol_update_date;
0126     struct yfs_xdr_u64  max_quota;
0127     struct yfs_xdr_u64  blocks_in_use;
0128     struct yfs_xdr_u64  blocks_avail;
0129 } __packed;
0130 
0131 enum yfs_volume_type {
0132     yfs_volume_type_ro = 0,
0133     yfs_volume_type_rw = 1,
0134 };
0135 
0136 #define yfs_FVSOnline       0x1
0137 #define yfs_FVSInservice    0x2
0138 #define yfs_FVSBlessed      0x4
0139 #define yfs_FVSNeedsSalvage 0x8
0140 
0141 struct yfs_xdr_YFSFetchVolumeStatus {
0142     struct yfs_xdr_u64  vid;
0143     struct yfs_xdr_u64  parent_id;
0144     __be32          flags;
0145     __be32          type;
0146     struct yfs_xdr_u64  max_quota;
0147     struct yfs_xdr_u64  blocks_in_use;
0148     struct yfs_xdr_u64  part_blocks_avail;
0149     struct yfs_xdr_u64  part_max_blocks;
0150     struct yfs_xdr_u64  vol_copy_date;
0151     struct yfs_xdr_u64  vol_backup_date;
0152 } __packed;
0153 
0154 struct yfs_xdr_YFSStoreVolumeStatus {
0155     __be32          mask;
0156     struct yfs_xdr_u64  min_quota;
0157     struct yfs_xdr_u64  max_quota;
0158     struct yfs_xdr_u64  file_quota;
0159 } __packed;
0160 
0161 enum yfs_lock_type {
0162     yfs_LockNone        = -1,
0163     yfs_LockRead        = 0,
0164     yfs_LockWrite       = 1,
0165     yfs_LockExtend      = 2,
0166     yfs_LockRelease     = 3,
0167     yfs_LockMandatoryRead   = 0x100,
0168     yfs_LockMandatoryWrite  = 0x101,
0169     yfs_LockMandatoryExtend = 0x102,
0170 };
0171 
0172 /* RXYFS Viced Capability Flags */
0173 #define YFS_VICED_CAPABILITY_ERRORTRANS     0x0001 /* Deprecated v0.195 */
0174 #define YFS_VICED_CAPABILITY_64BITFILES     0x0002 /* Deprecated v0.195 */
0175 #define YFS_VICED_CAPABILITY_WRITELOCKACL   0x0004 /* Can lock a file even without lock perm */
0176 #define YFS_VICED_CAPABILITY_SANEACLS       0x0008 /* Deprecated v0.195 */