s3: smbd: Remove unused counters for outstanding aio calls.
authorJeremy Allison <jra@samba.org>
Wed, 9 May 2018 16:32:45 +0000 (09:32 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 9 May 2018 20:24:38 +0000 (22:24 +0200)
Only a debug message used this.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May  9 22:24:38 CEST 2018 on sn-devel-144

source3/smbd/aio.c
source3/smbd/proto.h
source3/smbd/smb2_flush.c

index 4fc1132be87e359c6f8fc73ad41959738c6bbe2b..abf8858099b414f40c717a211014b4d4528ad980 100644 (file)
 #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;
 }
index 2f315ce056503844895fd4a52b79afb92e484ab8..778561c241c9f20a0aea7c93b1c1376e1863c7cf 100644 (file)
@@ -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,
index d1ab3a09839ece55471c63230ce87f8fde6be774..f7d9e964319a816925155dcc50d45ffbe9871ebf 100644 (file)
@@ -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) {