]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd4: share file descriptors between stateid's
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 8 Jul 2010 15:02:09 +0000 (11:02 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 29 Jul 2010 22:19:23 +0000 (18:19 -0400)
commitcb334ba06f34e06a42f1aee0d0fcc016fb0c9c51
treebbeb32b2cc49b6c6dafae57331a680b906017b6e
parentee7f7970f982f1930a8aa8bbe1cd8e309968be43
nfsd4: share file descriptors between stateid's

The vfs doesn't really allow us to "upgrade" a file descriptor from
read-only to read-write, and our attempt to do so in nfs4_upgrade_open
is ugly and incomplete.

Move to a different scheme where we keep multiple opens, shared between
open stateid's, in the nfs4_file struct.  Each file will be opened at
most 3 times (for read, write, and read-write), and those opens will be
shared between all clients and openers.  On upgrade we will do another
open if necessary instead of attempting to upgrade an existing open.
We keep count of the number of readers and writers so we know when to
close the shared files.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4state.c
fs/nfsd/nfsd.h
fs/nfsd/state.h