From 6d4df0f796fdb36f31a7176b8ed6a198e82d9c0c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 12 Oct 2013 02:40:12 +0200 Subject: [PATCH] s3:smb2_server: use tevent_req_notify_callback() in smbd_smb2_request_pending_queue() If the request is already done we can avoid one iteration of tevent_loop_once(), which means we avoids one talloc_stackframe_pool/talloc_free pair. Signed-off-by: Stefan Metzmacher Reviewed-by: David Disseldorp (cherry picked from commit acfd4b068a5b99ac1d3fe716afff34cb7d2a0147) --- source3/smbd/smb2_server.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index bc83b3fe7eb..9b5503ae004 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1252,6 +1252,13 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req, uint32_t flags; if (!tevent_req_is_in_progress(subreq)) { + /* + * This is a performance optimization, + * it avoids one tevent_loop iteration, + * which means we avoid one + * talloc_stackframe_pool/talloc_free pair. + */ + tevent_req_notify_callback(subreq); return NT_STATUS_OK; } -- 2.11.4.GIT