smbd: Add share_mode_do_locked()
authorVolker Lendecke <vl@samba.org>
Thu, 27 Jun 2019 15:23:07 +0000 (17:23 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 4 Jul 2019 14:03:29 +0000 (14:03 +0000)
commit44a77e6a5f9cb8c051648eb8f6759aadf3596544
tree6fa855f2bb968bf7fa6b81ed08a641e51f65bfed
parent0be81cda56788864f4a08aaa7e99746a6f61b1f1
smbd: Add share_mode_do_locked()

This is made for efficient locking of share mode records in
locking.tdb. Right now we already need that when accessing leases.tdb,
and soon it will be required for brlock.tdb as well. It does not give
direct access to the parsed share mode entry, but the record is
available for dbwrap_watched_wakeup() within downgrade_lease().

It can be freely nested with get_share_mode_lock calls, the record
will be shared and proper nesting should be checked.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/locking/proto.h
source3/locking/share_mode_lock.c