OSDN Git Service

nfsd: clean up nfs4_set_delegation
authorJeff Layton <jlayton@primarydata.com>
Fri, 25 Jul 2014 11:34:25 +0000 (07:34 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 29 Jul 2014 18:49:56 +0000 (14:49 -0400)
commit0b26693c56cc4beae2f913e737b15c12bc2b5b97
treebcaa584ee0e1b9c88d7e6bd04f24547c1668cc99
parent4cf59221c7cb46ce40e17bcfeddb64d759071440
nfsd: clean up nfs4_set_delegation

Move the alloc_init_deleg call into nfs4_set_delegation and change the
function to return a pointer to the delegation or an IS_ERR return. This
allows us to skip allocating a delegation if the file has already
experienced a lease conflict.

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