diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-05-16 17:42:43 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-05-17 15:48:06 -0400 |
commit | 93b717fd81bf6b9a73c3702e9b079b4de8148b34 (patch) | |
tree | 0ae5ec7f5a79410e12710941fffc9725a687c6d8 /include/linux/nfs4.h | |
parent | 9a8f6b5ea275ff01fc8ef3b8630a3d4ed6b0a362 (diff) |
NFSv4: Label stateids with the type
In order to more easily distinguish what kind of stateid we are dealing
with, introduce a type that can be used to label the stateid structure.
The label will be useful both for debugging, but also when dealing with
operations like SETATTR, READ and WRITE that can take several different
types of stateid as arguments.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include/linux/nfs4.h')
-rw-r--r-- | include/linux/nfs4.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 722509482e1a..e1692c96cbc8 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -50,12 +50,27 @@ struct nfs4_label { | |||
50 | 50 | ||
51 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; | 51 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
52 | 52 | ||
53 | struct nfs_stateid4 { | 53 | struct nfs4_stateid_struct { |
54 | __be32 seqid; | 54 | union { |
55 | char other[NFS4_STATEID_OTHER_SIZE]; | 55 | char data[NFS4_STATEID_SIZE]; |
56 | } __attribute__ ((packed)); | 56 | struct { |
57 | __be32 seqid; | ||
58 | char other[NFS4_STATEID_OTHER_SIZE]; | ||
59 | } __attribute__ ((packed)); | ||
60 | }; | ||
61 | |||
62 | enum { | ||
63 | NFS4_INVALID_STATEID_TYPE = 0, | ||
64 | NFS4_SPECIAL_STATEID_TYPE, | ||
65 | NFS4_OPEN_STATEID_TYPE, | ||
66 | NFS4_LOCK_STATEID_TYPE, | ||
67 | NFS4_DELEGATION_STATEID_TYPE, | ||
68 | NFS4_LAYOUT_STATEID_TYPE, | ||
69 | NFS4_PNFS_DS_STATEID_TYPE, | ||
70 | } type; | ||
71 | }; | ||
57 | 72 | ||
58 | typedef struct nfs_stateid4 nfs4_stateid; | 73 | typedef struct nfs4_stateid_struct nfs4_stateid; |
59 | 74 | ||
60 | enum nfs_opnum4 { | 75 | enum nfs_opnum4 { |
61 | OP_ACCESS = 3, | 76 | OP_ACCESS = 3, |