From: Volker Lendecke Date: Tue, 17 Dec 2019 13:20:48 +0000 (+0100) Subject: smbd: Introduce share_mode_have_entries() X-Git-Tag: ldb-2.1.0~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15977f5df85980ff0adbb372e4a4f0d51dde39dc;p=thirdparty%2Fsamba.git smbd: Introduce share_mode_have_entries() This hides a use of share_mode_data->num_share_modes in share_mode_lock.c Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/proto.h b/source3/locking/proto.h index dfbd59ede0c..b7098c1e788 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -149,6 +149,7 @@ NTSTATUS share_mode_do_locked( void *private_data), void *private_data); NTSTATUS share_mode_wakeup_waiters(struct file_id id); +bool share_mode_have_entries(struct share_mode_lock *lck); struct tevent_req *share_mode_watch_send( TALLOC_CTX *mem_ctx, diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 842d7d5df0c..66132e5d3bb 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -805,6 +805,11 @@ NTSTATUS share_mode_wakeup_waiters(struct file_id id) return share_mode_do_locked(id, share_mode_wakeup_waiters_fn, NULL); } +bool share_mode_have_entries(struct share_mode_lock *lck) +{ + return (lck->data->num_share_modes != 0); +} + struct share_mode_watch_state { struct tevent_context *ev; bool blockerdead;