Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSv4.2: Clean up xattr size macros

Fold them into the other NFS v4.2 operations in the right spots and
adjust spacing to keep the same style.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
64edd55d d5940973

+47 -49
+47 -49
fs/nfs/nfs42xdr.c
··· 7 7 8 8 #include "nfs42.h" 9 9 10 + /* Not limited by NFS itself, limited by the generic xattr code */ 11 + #define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX) 12 + 10 13 #define encode_fallocate_maxsz (encode_stateid_maxsz + \ 11 14 2 /* offset */ + \ 12 15 2 /* length */) ··· 92 89 2 /* dst offset */ + \ 93 90 2 /* count */) 94 91 #define decode_clone_maxsz (op_decode_hdr_maxsz) 92 + #define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \ 93 + nfs4_xattr_name_maxsz) 94 + #define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz) 95 + #define encode_setxattr_maxsz (op_encode_hdr_maxsz + \ 96 + 1 + nfs4_xattr_name_maxsz + 1) 97 + #define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) 98 + #define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1) 99 + #define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1) 100 + #define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \ 101 + nfs4_xattr_name_maxsz) 102 + #define decode_removexattr_maxsz (op_decode_hdr_maxsz + \ 103 + decode_change_info_maxsz) 95 104 96 105 #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ 97 106 encode_sequence_maxsz + \ ··· 201 186 decode_putfh_maxsz + \ 202 187 decode_clone_maxsz + \ 203 188 decode_getattr_maxsz) 204 - 205 - /* Not limited by NFS itself, limited by the generic xattr code */ 206 - #define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX) 207 - 208 - #define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \ 209 - nfs4_xattr_name_maxsz) 210 - #define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz) 211 - #define encode_setxattr_maxsz (op_encode_hdr_maxsz + \ 212 - 1 + nfs4_xattr_name_maxsz + 1) 213 - #define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) 214 - #define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1) 215 - #define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1) 216 - #define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \ 217 - nfs4_xattr_name_maxsz) 218 - #define decode_removexattr_maxsz (op_decode_hdr_maxsz + \ 219 - decode_change_info_maxsz) 220 - 221 - #define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \ 222 - encode_sequence_maxsz + \ 223 - encode_putfh_maxsz + \ 224 - encode_getxattr_maxsz) 225 - #define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \ 226 - decode_sequence_maxsz + \ 227 - decode_putfh_maxsz + \ 228 - decode_getxattr_maxsz) 229 - #define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \ 230 - encode_sequence_maxsz + \ 231 - encode_putfh_maxsz + \ 232 - encode_setxattr_maxsz) 233 - #define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \ 234 - decode_sequence_maxsz + \ 235 - decode_putfh_maxsz + \ 236 - decode_setxattr_maxsz) 237 - #define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \ 238 - encode_sequence_maxsz + \ 239 - encode_putfh_maxsz + \ 240 - encode_listxattrs_maxsz) 241 - #define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \ 242 - decode_sequence_maxsz + \ 243 - decode_putfh_maxsz + \ 244 - decode_listxattrs_maxsz) 245 - #define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \ 246 - encode_sequence_maxsz + \ 247 - encode_putfh_maxsz + \ 248 - encode_removexattr_maxsz) 249 - #define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \ 250 - decode_sequence_maxsz + \ 251 - decode_putfh_maxsz + \ 252 - decode_removexattr_maxsz) 189 + #define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \ 190 + encode_sequence_maxsz + \ 191 + encode_putfh_maxsz + \ 192 + encode_getxattr_maxsz) 193 + #define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \ 194 + decode_sequence_maxsz + \ 195 + decode_putfh_maxsz + \ 196 + decode_getxattr_maxsz) 197 + #define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \ 198 + encode_sequence_maxsz + \ 199 + encode_putfh_maxsz + \ 200 + encode_setxattr_maxsz) 201 + #define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \ 202 + decode_sequence_maxsz + \ 203 + decode_putfh_maxsz + \ 204 + decode_setxattr_maxsz) 205 + #define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \ 206 + encode_sequence_maxsz + \ 207 + encode_putfh_maxsz + \ 208 + encode_listxattrs_maxsz) 209 + #define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \ 210 + decode_sequence_maxsz + \ 211 + decode_putfh_maxsz + \ 212 + decode_listxattrs_maxsz) 213 + #define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \ 214 + encode_sequence_maxsz + \ 215 + encode_putfh_maxsz + \ 216 + encode_removexattr_maxsz) 217 + #define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \ 218 + decode_sequence_maxsz + \ 219 + decode_putfh_maxsz + \ 220 + decode_removexattr_maxsz) 253 221 254 222 /* 255 223 * These values specify the maximum amount of data that is not