]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove SMB_PERFCOUNT_ macros
authorVolker Lendecke <vl@samba.org>
Mon, 5 Jun 2023 13:35:07 +0000 (15:35 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 5 Jun 2023 17:17:35 +0000 (17:17 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/smb_perfcount.h
source3/smbd/smb1_nttrans.c
source3/smbd/smb1_process.c
source3/smbd/smb1_reply.c
source3/smbd/smb1_trans2.c

index efefb3c00b872d733fdf228dd139696c5b588d91..4f5039d9926c44d1cb3a55709efa4ea4dac64849 100644 (file)
@@ -52,54 +52,4 @@ NTSTATUS smb_register_perfcounter(int interface_version, const char *name,
 
 void smb_init_perfcount_data(struct smb_perfcount_data *pcd);
 
-#define SMB_PERFCOUNT_START(_pcd_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_start((_pcd_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_ADD(_pcd_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_add((_pcd_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_SET_OP(_pcd_,_op_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_set_op((_pcd_), (_op_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_SET_SUBOP(_pcd_,_subop_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_set_subop((_pcd_), (_subop_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_SET_IOCTL(_pcd_,_subop_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_set_ioctl((_pcd_), (_subop_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_SET_MSGLEN_IN(_pcd_,_in_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_set_msglen_in((_pcd_), (_in_));\
-    } while (0)
-
-#define SMB_PERFCOUNT_SET_MSGLEN_OUT(_pcd_,_out_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_set_msglen_out((_pcd_), (_out_));\
-    } while (0)
-
-#define SMB_PERFCOUNT_COPY_CONTEXT(_pcd_, _new_pcd_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_copy_context((_pcd_), (_new_pcd_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_DEFER_OP(_pcd_, _def_pcd_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_defer_op((_pcd_), (_def_pcd_)); \
-    } while (0)
-
-#define SMB_PERFCOUNT_END(_pcd_) \
-    do {if((_pcd_) && (_pcd_)->handlers) \
-           (_pcd_)->handlers->perfcount_end((_pcd_));\
-    } while (0)
-
 #endif /* _SMB_PERFCOUNT_H_ */
index 3cd8e41610741f342132b6eb88e6feed8b8fd588..1e2a7961d01fde014ef02413fff66e4c318c841e 100644 (file)
@@ -2025,8 +2025,6 @@ static void call_nt_transact_ioctl(connection_struct *conn,
                return;
        }
 
-       SMB_PERFCOUNT_SET_IOCTL(&req->pcd, function);
-
        /*
         * out_data might be allocated by the VFS module, but talloc should be
         * used, and should be cleaned up when the request ends.
@@ -2290,8 +2288,6 @@ static void handle_nttrans(connection_struct *conn,
        }
 
 
-       SMB_PERFCOUNT_SET_SUBOP(&req->pcd, state->call);
-
        /* Now we must call the relevant NT_TRANS function */
        switch(state->call) {
                case NT_TRANSACT_CREATE:
index 1834c67b91f5de912f6299ca5700964ac31843b6..accda5368c4f8c61deb721b8805c5a7589f0d2b6 100644 (file)
@@ -271,11 +271,8 @@ bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer,
                goto out;
        }
 
-       SMB_PERFCOUNT_SET_MSGLEN_OUT(pcd, len);
        srv_free_enc_buffer(xconn, buf_out);
 out:
-       SMB_PERFCOUNT_END(pcd);
-
        smbd_unlock_socket(xconn);
        return (ret > 0);
 }
@@ -566,7 +563,6 @@ static bool push_queued_message(struct smb_request *req,
        msg->seqnum = req->seqnum;
        msg->encrypted = req->encrypted;
        msg->processed = false;
-       SMB_PERFCOUNT_DEFER_OP(&req->pcd, &msg->pcd);
 
        if (open_rec) {
                msg->open_rec = talloc_move(msg, &open_rec);
@@ -1318,12 +1314,8 @@ void construct_reply(struct smbXsrv_connection *xconn,
        req->inbuf  = (uint8_t *)talloc_move(req, &inbuf);
 
        /* we popped this message off the queue - keep original perf data */
-       if (deferred_pcd)
+       if (deferred_pcd) {
                req->pcd = *deferred_pcd;
-       else {
-               SMB_PERFCOUNT_START(&req->pcd);
-               SMB_PERFCOUNT_SET_OP(&req->pcd, req->cmd);
-               SMB_PERFCOUNT_SET_MSGLEN_IN(&req->pcd, size);
        }
 
        req->conn = switch_message(req->cmd, req);
index 7921d6b261ba4229ba88f8919fc9e8d04c71c279..ee4752ff526f0487219e0b8b8023ca6105ebc9f6 100644 (file)
@@ -3381,8 +3381,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
                        }
                }
                /* No outbuf here means successful sendfile. */
-               SMB_PERFCOUNT_SET_MSGLEN_OUT(&req->pcd, nread);
-               SMB_PERFCOUNT_END(&req->pcd);
                goto out;
        }
 
@@ -5608,7 +5606,6 @@ void reply_echo(struct smb_request *req)
                if (seq_num == smb_reverb) {
                        cur_pcd = &req->pcd;
                } else {
-                       SMB_PERFCOUNT_COPY_CONTEXT(&req->pcd, &local_pcd);
                        cur_pcd = &local_pcd;
                }
 
index f24c9d8f87baaa95a021b75baf5c86d17606defd..e65a538692b8e70755a7e52fe9b651afe574a03c 100644 (file)
@@ -5172,8 +5172,6 @@ static void handle_trans2(connection_struct *conn, struct smb_request *req,
                }
        }
 
-       SMB_PERFCOUNT_SET_SUBOP(&req->pcd, state->call);
-
        /* Now we must call the relevant TRANS2 function */
        switch(state->call)  {
        case TRANSACT2_OPEN: