nfsd: tidy return values in nfs4_delegation_exists()
Subsystems (3)
PATCH 1/1 nfsd: tidy return values in nfs4_delegation_exists()
We made nfs4_delegation_exists() return a bool in 68b18f52947b ("nfsd:
make nfs4_get_existing_delegation less confusing"), but it's still returning -EINVAL. That's fine, because it -EINVAL becomes true which is what we want, but it's not very tidy.
fs/nfsd/nfs4state.c +2 -2
@@ -935,10 +935,10 @@ nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp)list_for_each_entry (searchdp, &fp->fi_delegations, dl_perfile) { searchclp = searchdp->dl_stid.sc_client;if (clp = searchclp) { -return -EAGAIN ; +return true; } } -return 0 ; +return false; }/**
Quoted 4 lines · Dan Carpenter
We made
nfs4_delegation_exists()return a bool in68b18f52947b("nfsd:
makenfs4_get_existing_delegationless confusing"), but it's still returning-EINVAL. That's fine, because it-EINVALbecomes true which is what we want, but it's not very tidy.
Oops, I fixed this a couple days ago when Fengguang Wu complained about the 0/false thing, but forgot to push it out. Added a Reported-by: for you and pushed it out now to
git://linux-nfs.org/~bfields/linux.git nfsd-next
--b.
Quoted 20 lines
Signed-off-by Dan Carpenter <[email protected]>fs/nfsd/nfs4state.c +2
-2@@ -935,10 +935,10 @@ nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp)list_for_each_entry (searchdp, &fp->fi_delegations, dl_perfile) { searchclp = searchdp->dl_stid.sc_client;if (clp = searchclp) { -return -EAGAIN ; +return true; } } -return 0 ; +return false; }/**