1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec  5 20:12:23 UTC 2019 on sn-devel-184
This commit is contained in:
Ralph Boehme 2019-11-28 10:18:29 +00:00 committed by Jeremy Allison
parent e30607aff3
commit 809247973d

View File

@ -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,19 +627,19 @@ struct share_mode_lock *get_share_mode_lock(
"simultaneously\n");
return NULL;
}
}
status = get_static_share_mode_data(
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_WARNING("get_static_share_mode_data failed: %s\n",
DBG_DEBUG("get_static_share_mode_data failed: %s\n",
nt_errstr(status));
TALLOC_FREE(static_share_mode_record);
goto fail;
}
}
done:
static_share_mode_data_refcount += 1;