From: Ralph Boehme Date: Thu, 28 Nov 2019 10:18:29 +0000 (+0000) Subject: s3:locking: simplify code in get_share_mode_lock() X-Git-Tag: ldb-2.1.0~438 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=809247973d9441c3d5249a7143cde6e858935d79;p=thirdparty%2Fsamba.git s3:locking: simplify code in get_share_mode_lock() The call to get_static_share_mode_data() is identical in the if/else branches, so move it behind them. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Dec 5 20:12:23 UTC 2019 on sn-devel-184 --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index c42cafe17e4..edf47274d29 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -615,18 +615,6 @@ struct share_mode_lock *get_share_mode_lock( static_share_mode_record_value = dbwrap_record_get_value( static_share_mode_record); - status = get_static_share_mode_data( - static_share_mode_record, - id, - servicepath, - smb_fname, - old_write_time); - if (!NT_STATUS_IS_OK(status)) { - DBG_DEBUG("get_static_share_mode_data failed: %s\n", - nt_errstr(status)); - TALLOC_FREE(static_share_mode_record); - goto fail; - } } else { TDB_DATA static_key; int cmp; @@ -639,18 +627,18 @@ struct share_mode_lock *get_share_mode_lock( "simultaneously\n"); return NULL; } + } - status = get_static_share_mode_data( - static_share_mode_record, - id, - servicepath, - smb_fname, - old_write_time); - if (!NT_STATUS_IS_OK(status)) { - DBG_WARNING("get_static_share_mode_data failed: %s\n", - nt_errstr(status)); - goto fail; - } + status = get_static_share_mode_data(static_share_mode_record, + id, + servicepath, + smb_fname, + old_write_time); + if (!NT_STATUS_IS_OK(status)) { + DBG_DEBUG("get_static_share_mode_data failed: %s\n", + nt_errstr(status)); + TALLOC_FREE(static_share_mode_record); + goto fail; } done: