summaryrefslogtreecommitdiffstats
path: root/include/linux/nfs4.h
diff options
context:
space:
mode:
authorAlexandros Batsakis <batsakis@netapp.com>2010-10-20 00:17:56 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-10-24 18:02:53 -0400
commit9449925273933d19235d7d36c1fd970841d055de (patch)
tree849b6ef6684e17effa3401fdae698b1af5111050 /include/linux/nfs4.h
parentc772567d97fa0fca454eea68aeae915ca1bc732b (diff)
NFS: change stateid to be a union
In NFSv4.1 the stateid consists of the other and seqid fields. For layout processing we need to numerically compare the seqid value of layout stateids. To do so, introduce a union to nfs4_stateid to switch between opaque(16 bytes) and opaque(12 bytes) / __be32 Signed-off-by: Alexandros Batsakis <batsakis@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/nfs4.h')
-rw-r--r--include/linux/nfs4.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 6c0406e87d5..34da32436ac 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -17,7 +17,9 @@
#define NFS4_BITMAP_SIZE 2
#define NFS4_VERIFIER_SIZE 8
-#define NFS4_STATEID_SIZE 16
+#define NFS4_STATEID_SEQID_SIZE 4
+#define NFS4_STATEID_OTHER_SIZE 12
+#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
#define NFS4_FHSIZE 128
#define NFS4_MAXPATHLEN PATH_MAX
#define NFS4_MAXNAMLEN NAME_MAX
@@ -167,7 +169,16 @@ struct nfs4_acl {
};
typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
-typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid;
+
+struct nfs41_stateid {
+ __be32 seqid;
+ char other[NFS4_STATEID_OTHER_SIZE];
+} __attribute__ ((packed));
+
+typedef union {
+ char data[NFS4_STATEID_SIZE];
+ struct nfs41_stateid stateid;
+} nfs4_stateid;
enum nfs_opnum4 {
OP_ACCESS = 3,