Skip to contentSkip to conversation

nfsd: Remove duplicate macro define for max sec label length

PATCH In review Kinglong Mee 2 participants 2 messages Mar 28, 2015 – Mar 31, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: Remove duplicate macro define for max sec label length

NFS4_MAXLABELLEN has defined for sec label max length, use it directly.

---
 fs/nfsd/nfs4proc.c | 2 +-
 fs/nfsd/nfs4xdr.c  | 2 +-
 fs/nfsd/xdr4.h     | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
fs/nfsd/nfs4proc.c +1 -1
index d30bea8..6bd4391 100644
@@ -1815,7 +1815,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp,
 		bmap0 &= ~FATTR4_WORD0_FILEHANDLE;
 	}
 	if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) {
-		ret += NFSD4_MAX_SEC_LABEL_LEN + 12;
+		ret += NFS4_MAXLABELLEN + 12;
 		bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL;
 	}
 	/*
fs/nfsd/nfs4xdr.c +1 -1
index df5e66c..eff0a94 100644
@@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 		len += 4;
 		dummy32 = be32_to_cpup(p++);
 		READ_BUF(dummy32);
-		if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN)
+		if (dummy32 > NFS4_MAXLABELLEN)
 			return nfserr_badlabel;
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
fs/nfsd/xdr4.h +0 -1
index 0bda93e..8bae5d8 100644
@@ -40,7 +40,6 @@
 #include "state.h"
 #include "nfsd.h"
 
-#define NFSD4_MAX_SEC_LABEL_LEN	2048
 #define NFSD4_MAX_TAGLEN	128
 #define XDR_LEN(n)                     (((n) + 3) & ~3)
 
Signature · 1 line
2.3.4
#1 lore raw
Quoted 1 line · Kinglong Mee

NFS4_MAXLABELLEN has defined for sec label max length, use it directly.

Thanks, applying for 4.1--b.

Quoted 48 lines
---
 fs/nfsd/nfs4proc.c | 2 +-
 fs/nfsd/nfs4xdr.c  | 2 +-
 fs/nfsd/xdr4.h     | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
fs/nfsd/nfs4proc.c +1 -1
index d30bea8..6bd4391 100644
@@ -1815,7 +1815,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp,
 		bmap0 &= ~FATTR4_WORD0_FILEHANDLE;
 	}
 	if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) {
-		ret += NFSD4_MAX_SEC_LABEL_LEN + 12;
+		ret += NFS4_MAXLABELLEN + 12;
 		bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL;
 	}
 	/*
fs/nfsd/nfs4xdr.c +1 -1
index df5e66c..eff0a94 100644
@@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 		len += 4;
 		dummy32 = be32_to_cpup(p++);
 		READ_BUF(dummy32);
-		if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN)
+		if (dummy32 > NFS4_MAXLABELLEN)
 			return nfserr_badlabel;
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
fs/nfsd/xdr4.h +0 -1
index 0bda93e..8bae5d8 100644
@@ -40,7 +40,6 @@
 #include "state.h"
 #include "nfsd.h"
 
-#define NFSD4_MAX_SEC_LABEL_LEN	2048
 #define NFSD4_MAX_TAGLEN	128
 #define XDR_LEN(n)                     (((n) + 3) & ~3)
 
Signature · 1 line
2.3.4