1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
4 #include <linux/nfsacl.h>
13 #define NFS_MAX_FILE_IO_SIZE (1048576U)
14 #define NFS_DEF_FILE_IO_SIZE (4096U)
15 #define NFS_MIN_FILE_IO_SIZE (1024U)
18 struct nfs4_secinfo_flavors;
82 #define NFS_ATTR_FATTR_TYPE (1U << 0)
83 #define NFS_ATTR_FATTR_MODE (1U << 1)
84 #define NFS_ATTR_FATTR_NLINK (1U << 2)
85 #define NFS_ATTR_FATTR_OWNER (1U << 3)
86 #define NFS_ATTR_FATTR_GROUP (1U << 4)
87 #define NFS_ATTR_FATTR_RDEV (1U << 5)
88 #define NFS_ATTR_FATTR_SIZE (1U << 6)
89 #define NFS_ATTR_FATTR_PRESIZE (1U << 7)
90 #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
91 #define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
92 #define NFS_ATTR_FATTR_FSID (1U << 10)
93 #define NFS_ATTR_FATTR_FILEID (1U << 11)
94 #define NFS_ATTR_FATTR_ATIME (1U << 12)
95 #define NFS_ATTR_FATTR_MTIME (1U << 13)
96 #define NFS_ATTR_FATTR_CTIME (1U << 14)
97 #define NFS_ATTR_FATTR_PREMTIME (1U << 15)
98 #define NFS_ATTR_FATTR_PRECTIME (1U << 16)
99 #define NFS_ATTR_FATTR_CHANGE (1U << 17)
100 #define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
101 #define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19)
102 #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20)
103 #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21)
104 #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
105 #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23)
106 #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24)
108 #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
109 | NFS_ATTR_FATTR_MODE \
110 | NFS_ATTR_FATTR_NLINK \
111 | NFS_ATTR_FATTR_OWNER \
112 | NFS_ATTR_FATTR_GROUP \
113 | NFS_ATTR_FATTR_RDEV \
114 | NFS_ATTR_FATTR_SIZE \
115 | NFS_ATTR_FATTR_FSID \
116 | NFS_ATTR_FATTR_FILEID \
117 | NFS_ATTR_FATTR_ATIME \
118 | NFS_ATTR_FATTR_MTIME \
119 | NFS_ATTR_FATTR_CTIME \
120 | NFS_ATTR_FATTR_CHANGE)
121 #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
122 | NFS_ATTR_FATTR_BLOCKS_USED)
123 #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
124 | NFS_ATTR_FATTR_SPACE_USED)
125 #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
126 | NFS_ATTR_FATTR_SPACE_USED)
216 #define PNFS_LAYOUT_MAXSIZE 4096
658 #define NFS4_ACL_TRUNC 0x0001
830 #if IS_ENABLED(CONFIG_NFS_V4)
832 typedef u64 clientid4;
834 struct nfs4_accessargs {
841 struct nfs4_accessres {
849 struct nfs4_create_arg {
863 const struct iattr * attrs;
864 const struct nfs_fh * dir_fh;
869 struct nfs4_create_res {
877 struct nfs4_fsinfo_arg {
883 struct nfs4_fsinfo_res {
888 struct nfs4_getattr_arg {
894 struct nfs4_getattr_res {
900 struct nfs4_link_arg {
902 const struct nfs_fh * dir_fh;
908 struct nfs4_link_res {
917 struct nfs4_lookup_arg {
918 const struct nfs_fh * dir_fh;
924 struct nfs4_lookup_res {
931 struct nfs4_lookup_root_arg {
936 struct nfs4_pathconf_arg {
942 struct nfs4_pathconf_res {
947 struct nfs4_readdir_arg {
959 struct nfs4_readdir_res {
965 struct nfs4_readlink {
973 struct nfs4_readlink_res {
977 #define NFS4_SETCLIENTID_NAMELEN (127)
978 struct nfs4_setclientid {
980 unsigned int sc_name_len;
981 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
983 unsigned int sc_netid_len;
984 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
985 unsigned int sc_uaddr_len;
986 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
990 struct nfs4_setclientid_res {
995 struct nfs4_statfs_arg {
1001 struct nfs4_statfs_res {
1006 struct nfs4_server_caps_arg {
1011 struct nfs4_server_caps_res {
1012 u32 attr_bitmask[3];
1020 #define NFS4_PATHNAME_MAXCOMPONENTS 512
1021 struct nfs4_pathname {
1022 unsigned int ncomponents;
1023 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
1026 #define NFS4_FS_LOCATION_MAXSERVERS 10
1027 struct nfs4_fs_location {
1028 unsigned int nservers;
1029 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
1030 struct nfs4_pathname rootpath;
1033 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
1034 struct nfs4_fs_locations {
1039 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
1042 struct nfs4_fs_locations_arg {
1043 const struct nfs_fh *dir_fh;
1050 struct nfs4_fs_locations_res {
1051 struct nfs4_fs_locations *fs_locations;
1055 struct nfs4_secinfo_oid {
1057 char data[GSS_OID_MAX_LEN];
1060 struct nfs4_secinfo_gss {
1061 struct nfs4_secinfo_oid sec_oid4;
1066 struct nfs4_secinfo_flavor {
1067 unsigned int flavor;
1068 struct nfs4_secinfo_gss gss;
1071 struct nfs4_secinfo_flavors {
1072 unsigned int num_flavors;
1073 struct nfs4_secinfo_flavor flavors[0];
1076 struct nfs4_secinfo_arg {
1077 const struct nfs_fh *dir_fh;
1082 struct nfs4_secinfo_res {
1083 struct nfs4_secinfo_flavors *flavors;
1094 #ifdef CONFIG_NFS_V4_1
1096 struct pnfs_commit_bucket {
1107 struct pnfs_commit_bucket *buckets;
1110 #define NFS4_EXCHANGE_ID_LEN (48)
1111 struct nfs41_exchange_id_args {
1114 unsigned int id_len;
1115 char id[NFS4_EXCHANGE_ID_LEN];
1119 struct nfs41_server_owner {
1125 struct nfs41_server_scope {
1130 struct nfs41_impl_id {
1136 struct nfs41_bind_conn_to_session_res {
1137 struct nfs4_session *session;
1139 bool use_conn_in_rdma_mode;
1142 struct nfs41_exchange_id_res {
1146 struct nfs41_server_owner *server_owner;
1147 struct nfs41_server_scope *server_scope;
1148 struct nfs41_impl_id *impl_id;
1151 struct nfs41_create_session_args {
1159 struct nfs41_create_session_res {
1163 struct nfs41_reclaim_complete_args {
1165 unsigned char one_fs:1;
1169 struct nfs41_reclaim_complete_res {
1173 #define SECINFO_STYLE_CURRENT_FH 0
1174 #define SECINFO_STYLE_PARENT 1
1175 struct nfs41_secinfo_no_name_args {
1180 struct nfs41_test_stateid_args {
1185 struct nfs41_test_stateid_res {
1190 struct nfs41_free_stateid_args {
1195 struct nfs41_free_stateid_res {
1209 #define NFS_PAGEVEC_SIZE (8U)
1444 const char *, rpc_authflavor_t);
1456 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args