s3:smbd: split out some generic code from close_remove_share_mode()
commitf9ea78398949109ba7fec90cbaaf294a446042ca
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Aug 2022 05:31:41 +0000 (30 05:31 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:36 +0000 (20 00:34 +0000)
tree0f91d39e4d9e74b80f26fe78451d5d1151407983
parent0f02f68f9f197ee7ec4b24a32a7b5a4b985ebe9b
s3:smbd: split out some generic code from close_remove_share_mode()

close_share_mode_lock_prepare() will operates on share_mode_lock
in order to check if the object needs to be deleted or if
we can remove the share_mode_entry directly.

close_share_mode_lock_cleanup() will finish after the object
has been deleted.

We can reuse these function in close_directory() soon and
in the end we'll avoid get_existing_share_mode_lock()
and call them via share_mode_entry_prepare_{lock,unlock}(),
so that they can run under a tdb chainlock.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/close.c