From 8ae20abdd18c6c7f21bbae931353e7cfad77d7b6 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 14 May 2007 16:50:45 -0400 Subject: NFS4: Fix incorrect use of sizeof() in fs/nfs/nfs4xdr.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The XDR code should not depend on the physical allocation size of structures like nfs4_stateid and nfs4_verifier since those may have to change at some future date. We therefore replace all uses of sizeof() with constants like NFS4_VERIFIER_SIZE and NFS4_STATEID_SIZE. This also has the side-effect of fixing some warnings of the type format ‘%u’ expects type ‘unsigned int’, but argument X has type ‘long unsigned int’ on 64-bit systems Signed-off-by: Trond Myklebust --- include/linux/nfs4.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 1be5be8..7e7f33a 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -16,6 +16,7 @@ #include #define NFS4_VERIFIER_SIZE 8 +#define NFS4_STATEID_SIZE 16 #define NFS4_FHSIZE 128 #define NFS4_MAXPATHLEN PATH_MAX #define NFS4_MAXNAMLEN NAME_MAX @@ -113,7 +114,7 @@ struct nfs4_acl { }; typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; -typedef struct { char data[16]; } nfs4_stateid; +typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid; enum nfs_opnum4 { OP_ACCESS = 3, -- cgit v1.1