Skip to content

Commit 64edd55

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
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>
1 parent d594097 commit 64edd55

1 file changed

Lines changed: 47 additions & 49 deletions

File tree

fs/nfs/nfs42xdr.c

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#include "nfs42.h"
99

10+
/* Not limited by NFS itself, limited by the generic xattr code */
11+
#define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX)
12+
1013
#define encode_fallocate_maxsz (encode_stateid_maxsz + \
1114
2 /* offset */ + \
1215
2 /* length */)
@@ -89,6 +92,18 @@
8992
2 /* dst offset */ + \
9093
2 /* count */)
9194
#define decode_clone_maxsz (op_decode_hdr_maxsz)
95+
#define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \
96+
nfs4_xattr_name_maxsz)
97+
#define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz)
98+
#define encode_setxattr_maxsz (op_encode_hdr_maxsz + \
99+
1 + nfs4_xattr_name_maxsz + 1)
100+
#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz)
101+
#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1)
102+
#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1)
103+
#define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \
104+
nfs4_xattr_name_maxsz)
105+
#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \
106+
decode_change_info_maxsz)
92107

93108
#define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \
94109
encode_sequence_maxsz + \
@@ -186,55 +201,38 @@
186201
decode_putfh_maxsz + \
187202
decode_clone_maxsz + \
188203
decode_getattr_maxsz)
189-
190-
/* Not limited by NFS itself, limited by the generic xattr code */
191-
#define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX)
192-
193-
#define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \
194-
nfs4_xattr_name_maxsz)
195-
#define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz)
196-
#define encode_setxattr_maxsz (op_encode_hdr_maxsz + \
197-
1 + nfs4_xattr_name_maxsz + 1)
198-
#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz)
199-
#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1)
200-
#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1)
201-
#define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \
202-
nfs4_xattr_name_maxsz)
203-
#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \
204-
decode_change_info_maxsz)
205-
206-
#define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \
207-
encode_sequence_maxsz + \
208-
encode_putfh_maxsz + \
209-
encode_getxattr_maxsz)
210-
#define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \
211-
decode_sequence_maxsz + \
212-
decode_putfh_maxsz + \
213-
decode_getxattr_maxsz)
214-
#define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \
215-
encode_sequence_maxsz + \
216-
encode_putfh_maxsz + \
217-
encode_setxattr_maxsz)
218-
#define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \
219-
decode_sequence_maxsz + \
220-
decode_putfh_maxsz + \
221-
decode_setxattr_maxsz)
222-
#define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \
223-
encode_sequence_maxsz + \
224-
encode_putfh_maxsz + \
225-
encode_listxattrs_maxsz)
226-
#define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \
227-
decode_sequence_maxsz + \
228-
decode_putfh_maxsz + \
229-
decode_listxattrs_maxsz)
230-
#define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \
231-
encode_sequence_maxsz + \
232-
encode_putfh_maxsz + \
233-
encode_removexattr_maxsz)
234-
#define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \
235-
decode_sequence_maxsz + \
236-
decode_putfh_maxsz + \
237-
decode_removexattr_maxsz)
204+
#define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \
205+
encode_sequence_maxsz + \
206+
encode_putfh_maxsz + \
207+
encode_getxattr_maxsz)
208+
#define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \
209+
decode_sequence_maxsz + \
210+
decode_putfh_maxsz + \
211+
decode_getxattr_maxsz)
212+
#define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \
213+
encode_sequence_maxsz + \
214+
encode_putfh_maxsz + \
215+
encode_setxattr_maxsz)
216+
#define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \
217+
decode_sequence_maxsz + \
218+
decode_putfh_maxsz + \
219+
decode_setxattr_maxsz)
220+
#define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \
221+
encode_sequence_maxsz + \
222+
encode_putfh_maxsz + \
223+
encode_listxattrs_maxsz)
224+
#define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \
225+
decode_sequence_maxsz + \
226+
decode_putfh_maxsz + \
227+
decode_listxattrs_maxsz)
228+
#define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \
229+
encode_sequence_maxsz + \
230+
encode_putfh_maxsz + \
231+
encode_removexattr_maxsz)
232+
#define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \
233+
decode_sequence_maxsz + \
234+
decode_putfh_maxsz + \
235+
decode_removexattr_maxsz)
238236

239237
/*
240238
* These values specify the maximum amount of data that is not

0 commit comments

Comments
 (0)