s3/locking: add share_mode_forall() and share_mode_forall_read() varients
commitbd120224dbaf531c1f028ea4a3fc8a0b200dce6a
authorRalph Boehme <slow@samba.org>
Sat, 12 Oct 2024 15:32:01 +0000 (12 17:32 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (5 14:39 +0000)
tree8e129779a229aaa01388226b0cfbc271a9c5106b
parent9b4ff5ff28e35d1f7837b44a2b47c3ee2691b3b0
s3/locking: add share_mode_forall() and share_mode_forall_read() varients

All existing callers use share_mode_forall_read(), so no change in behaviour.

Note: doing the indirection via the function pointers "ro_fn" and "rw_fn" in a
single state "struct share_mode_forall_state" avoids duplicating
share_mode_forall_dump_fn() and share_mode_forall_fn() and has the benefit of
code sharing of these functions for both read-only and read-write cases.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/locking/share_mode_lock.c
source3/locking/share_mode_lock.h
source3/smbd/dir.c