smbd: Introduce close_file_smb()
authorVolker Lendecke <vl@samba.org>
Wed, 9 Feb 2022 17:03:33 +0000 (18:03 +0100)
committerJule Anger <janger@samba.org>
Mon, 14 Feb 2022 17:46:14 +0000 (17:46 +0000)
commitd44c45cbdbc7e13047ce127ea7ebcac2810a7891
tree84c7d48819cb6a89bb0cd69d2815e6ea41f77849
parent521178327e4ca5581d741966e8c288253be3d8f3
smbd: Introduce close_file_smb()

This does almost everything that close_file_free() does, but it leaves
the fsp around.

A normal close_file() now calls fsp_unbind_smb() twice. Functionally
this is not a problem, fsp_unbind_smb() is idempotent. The only
potential performance penalty might come from the loops in
remove_smb2_chained_fsp(), but those only are potentially large with
deeply queued smb2 requests. If that turns out to be a problem, we'll
cope with it later. The alternative would be to split up file_free()
into even more routines and make it more difficult to figure out which
of the "rundown/unbind/free" routines to call in any particular
situation.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14975

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e91b59c4dfb2b35661dbecbc5769584109e23571)
source3/smbd/close.c
source3/smbd/proto.h