nfsd: refactor nfs4_file_get_access and nfs4_file_put_access
authorJeff Layton <jlayton@primarydata.com>
Thu, 10 Jul 2014 18:07:28 +0000 (14:07 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 11 Jul 2014 15:03:23 +0000 (11:03 -0400)
commit12659651721a1c291ec8e1976925985a2c1bfe7c
tree8aee1ab9b3d01e0545d2ef60951da96d19fd7690
parente20fcf1e6586ff1620adc345ad2a93d5ee5def59
nfsd: refactor nfs4_file_get_access and nfs4_file_put_access

Have them take NFS4_SHARE_ACCESS_* flags instead of an open mode. This
spares the callers from having to convert it themselves.

This also allows us to simplify these functions as we no longer need
to do the access_to_omode conversion in either one.

Note too that this patch eliminates the WARN_ON in
__nfs4_file_get_access. It's valid for now, but in a later patch we'll
be bumping the refcounts prior to opening the file in order to close
some races, at which point we'll need to remove it anyway.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c