1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-03 12:58:35 +03:00

smbd: Small optimization for break_to_none

We don't need to memzero the struct when we can struct-initialize it a
bit later, implicitly initializing the rest to zero.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
This commit is contained in:
Volker Lendecke 2019-04-09 16:34:24 +02:00 committed by Christof Schmitt
parent 98521ce51c
commit b3d0c7e32c

View File

@ -1192,13 +1192,14 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
* anyway, so we postpone this into an immediate event.
*/
state = talloc_zero(sconn, struct break_to_none_state);
state = talloc(sconn, struct break_to_none_state);
if (state == NULL) {
DEBUG(1, ("talloc failed\n"));
return;
}
state->sconn = sconn;
state->id = fsp->file_id;
*state = (struct break_to_none_state) {
.sconn = sconn, .id = fsp->file_id,
};
if (fsp->oplock_type == LEASE_OPLOCK) {
state->client_guid = *fsp_client_guid(fsp);