mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 22:04:47 +08:00
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 <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
de18643dce
commit
e20fcf1e65
@ -821,10 +821,8 @@ static void __release_lock_stateid(struct nfs4_ol_stateid *stp)
|
|||||||
unhash_generic_stateid(stp);
|
unhash_generic_stateid(stp);
|
||||||
unhash_stid(&stp->st_stid);
|
unhash_stid(&stp->st_stid);
|
||||||
file = find_any_file(stp->st_file);
|
file = find_any_file(stp->st_file);
|
||||||
if (file) {
|
if (file)
|
||||||
locks_remove_posix(file, (fl_owner_t)lockowner(stp->st_stateowner));
|
filp_close(file, (fl_owner_t)lockowner(stp->st_stateowner));
|
||||||
fput(file);
|
|
||||||
}
|
|
||||||
close_generic_stateid(stp);
|
close_generic_stateid(stp);
|
||||||
free_generic_stateid(stp);
|
free_generic_stateid(stp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user