diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-03 03:55:13 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:43 -0500 |
commit | e761692381f294ea079d2e869fcd7c0afc79e394 (patch) | |
tree | 34ebc00c001cddc94866936c460547d311e5dabb /fs/nfs/nfs4_fs.h | |
parent | cdd4e68b5f0ed12c64b3e2be83655d2a47588a74 (diff) |
NFSv4: Make nfs4_state track O_RDWR, O_RDONLY and O_WRONLY separately
A closer reading of RFC3530 reveals that OPEN_DOWNGRADE must always
specify a access modes that have been the argument of a previous OPEN
operation.
IOW: doing OPEN(O_RDWR) and then OPEN_DOWNGRADE(O_WRONLY) is forbidden
unless the user called OPEN(O_WRONLY)
In order to fix that, we really need to track the three possible open
states separately.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
-rw-r--r-- | fs/nfs/nfs4_fs.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index b7f262dcb6e3..4ad5981f9375 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -182,8 +182,9 @@ struct nfs4_state { | |||
182 | 182 | ||
183 | nfs4_stateid stateid; | 183 | nfs4_stateid stateid; |
184 | 184 | ||
185 | unsigned int nreaders; | 185 | unsigned int n_rdonly; |
186 | unsigned int nwriters; | 186 | unsigned int n_wronly; |
187 | unsigned int n_rdwr; | ||
187 | int state; /* State on the server (R,W, or RW) */ | 188 | int state; /* State on the server (R,W, or RW) */ |
188 | atomic_t count; | 189 | atomic_t count; |
189 | }; | 190 | }; |