From: Volker Lendecke Date: Tue, 9 Apr 2019 14:34:24 +0000 (+0200) Subject: smbd: Small optimization for break_to_none X-Git-Tag: tdb-1.4.1~430 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d0c7e32c9b56dad9003f6bbb067da4aa0a6753;p=thirdparty%2Fsamba.git 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 Reviewed-by: Christof Schmitt --- diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 31a36304310..cb471fad1ac 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -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);