From: Trond Myklebust Date: Thu, 10 Jul 2014 18:07:27 +0000 (-0400) Subject: nfsd: clean up helper __release_lock_stateid X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e20fcf1e6586ff1620adc345ad2a93d5ee5def59;p=linux-beck.git nfsd: clean up helper __release_lock_stateid Use filp_close instead of open coding. filp_close does a bit more than just release the locks and put the filp. It also calls ->flush and dnotify_flush, both of which should be done here anyway. Signed-off-by: Trond Myklebust Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 314dc8061461..4ab567e7db0f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -821,10 +821,8 @@ static void __release_lock_stateid(struct nfs4_ol_stateid *stp) unhash_generic_stateid(stp); unhash_stid(&stp->st_stid); file = find_any_file(stp->st_file); - if (file) { - locks_remove_posix(file, (fl_owner_t)lockowner(stp->st_stateowner)); - fput(file); - } + if (file) + filp_close(file, (fl_owner_t)lockowner(stp->st_stateowner)); close_generic_stateid(stp); free_generic_stateid(stp); }