aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4state.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 5e609b17ada4..eb9cf818002a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -282,14 +282,19 @@ static unsigned int file_hashval(struct inode *ino)
282 282
283static struct hlist_head file_hashtbl[FILE_HASH_SIZE]; 283static struct hlist_head file_hashtbl[FILE_HASH_SIZE];
284 284
285static void __nfs4_file_get_access(struct nfs4_file *fp, int oflag)
286{
287 WARN_ON_ONCE(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]));
288 atomic_inc(&fp->fi_access[oflag]);
289}
290
285static void nfs4_file_get_access(struct nfs4_file *fp, int oflag) 291static void nfs4_file_get_access(struct nfs4_file *fp, int oflag)
286{ 292{
287 WARN_ON_ONCE(!fp->fi_fds[oflag]);
288 if (oflag == O_RDWR) { 293 if (oflag == O_RDWR) {
289 atomic_inc(&fp->fi_access[O_RDONLY]); 294 __nfs4_file_get_access(fp, O_RDONLY);
290 atomic_inc(&fp->fi_access[O_WRONLY]); 295 __nfs4_file_get_access(fp, O_WRONLY);
291 } else 296 } else
292 atomic_inc(&fp->fi_access[oflag]); 297 __nfs4_file_get_access(fp, oflag);
293} 298}
294 299
295static void nfs4_file_put_fd(struct nfs4_file *fp, int oflag) 300static void nfs4_file_put_fd(struct nfs4_file *fp, int oflag)