OSDN Git Service

nfsd: create a separate lease for each delegation
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 16 Feb 2018 19:29:42 +0000 (14:29 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 20 Mar 2018 21:51:14 +0000 (17:51 -0400)
commit353601e7d323c700d891d0ede2bbf13c050741a5
treea5030bd1b7f37dd05d0458a4121a5d646c71456c
parent86d29b10eb666f72da70bd5cf9c80b4446270c8c
nfsd: create a separate lease for each delegation

Currently we only take one vfs-level delegation (lease) for each file,
no matter how many clients hold delegations on that file.

Let's instead keep a one-to-one mapping between NFSv4 delegations and
VFS delegations.  This turns out to be simpler.

There is still a many-to-one mapping of NFS opens to NFS files, and the
delegations on one file are all associated with one struct file.  The
VFS can still distinguish between these delegations since we're setting
fl_owner to the struct nfs4_delegation now, not to the shared file.

I'm replacing at least one complicated function wholesale, which I don't
like to do, but I haven't figured out how to do this more incrementally.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
fs/nfsd/nfs4state.c