From 1ef0d1bf8de42e729377fc9ca6db648a829cd98a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 9 May 2018 09:32:45 -0700 Subject: [PATCH] s3: smbd: Remove unused counters for outstanding aio calls. Only a debug message used this. Signed-off-by: Jeremy Allison --- source3/smbd/aio.c | 41 ++++----------------------------------- source3/smbd/proto.h | 3 --- source3/smbd/smb2_flush.c | 3 --- 3 files changed, 4 insertions(+), 43 deletions(-) diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index 4fc1132be87..abf8858099b 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -25,27 +25,6 @@ #include "../lib/util/tevent_unix.h" #include "lib/tevent_wait.h" -/**************************************************************************** - Statics plus accessor functions. -*****************************************************************************/ - -static int outstanding_aio_calls; - -int get_outstanding_aio_calls(void) -{ - return outstanding_aio_calls; -} - -void increment_outstanding_aio_calls(void) -{ - outstanding_aio_calls++; -} - -void decrement_outstanding_aio_calls(void) -{ - outstanding_aio_calls--; -} - /**************************************************************************** The buffer we keep around whilst an aio request is in process. *****************************************************************************/ @@ -69,12 +48,6 @@ bool aio_write_through_requested(struct aio_extra *aio_ex) return aio_ex->write_through; } -static int aio_extra_destructor(struct aio_extra *aio_ex) -{ - decrement_outstanding_aio_calls(); - return 0; -} - /**************************************************************************** Create the extended aio struct we must keep around for the lifetime of the aio call. @@ -101,9 +74,7 @@ static struct aio_extra *create_aio_extra(TALLOC_CTX *mem_ctx, return NULL; } } - talloc_set_destructor(aio_ex, aio_extra_destructor); aio_ex->fsp = fsp; - increment_outstanding_aio_calls(); return aio_ex; } @@ -523,11 +494,9 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn, } DEBUG(10,("schedule_aio_write_and_X: scheduled aio_write for file " - "%s, offset %.0f, len = %u (mid = %u) " - "outstanding_aio_calls = %d\n", + "%s, offset %.0f, len = %u (mid = %u)\n", fsp_str_dbg(fsp), (double)startpos, (unsigned int)numtowrite, - (unsigned int)aio_ex->smbreq->mid, - get_outstanding_aio_calls() )); + (unsigned int)aio_ex->smbreq->mid)); return NT_STATUS_OK; } @@ -906,13 +875,11 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn, */ DEBUG(10,("smb2: scheduled aio_write for file " - "%s, offset %.0f, len = %u (mid = %u) " - "outstanding_aio_calls = %d\n", + "%s, offset %.0f, len = %u (mid = %u)\n", fsp_str_dbg(fsp), (double)in_offset, (unsigned int)in_data.length, - (unsigned int)aio_ex->smbreq->mid, - get_outstanding_aio_calls() )); + (unsigned int)aio_ex->smbreq->mid)); return NT_STATUS_OK; } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 2f315ce0565..778561c241c 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -66,9 +66,6 @@ void srv_set_signing(struct smbXsrv_connection *conn, /* The following definitions come from smbd/aio.c */ -int get_outstanding_aio_calls(void); -void increment_outstanding_aio_calls(void); -void decrement_outstanding_aio_calls(void); struct aio_extra; bool aio_write_through_requested(struct aio_extra *aio_ex); NTSTATUS schedule_aio_read_and_X(connection_struct *conn, diff --git a/source3/smbd/smb2_flush.c b/source3/smbd/smb2_flush.c index d1ab3a09839..f7d9e964319 100644 --- a/source3/smbd/smb2_flush.c +++ b/source3/smbd/smb2_flush.c @@ -184,7 +184,6 @@ static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - increment_outstanding_aio_calls(); return req; } @@ -196,8 +195,6 @@ static void smbd_smb2_flush_done(struct tevent_req *subreq) int ret; struct vfs_aio_state vfs_aio_state; - decrement_outstanding_aio_calls(); - ret = SMB_VFS_FSYNC_RECV(subreq, &vfs_aio_state); TALLOC_FREE(subreq); if (ret == -1) { -- 2.17.0