From: Volker Lendecke Date: Mon, 5 Jun 2023 13:35:07 +0000 (+0200) Subject: smbd: Remove SMB_PERFCOUNT_ macros X-Git-Tag: talloc-2.4.1~497 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fa8a1e166ce986a53601359469591babb1f75b4;p=thirdparty%2Fsamba.git smbd: Remove SMB_PERFCOUNT_ macros Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/smb_perfcount.h b/source3/include/smb_perfcount.h index efefb3c00b8..4f5039d9926 100644 --- a/source3/include/smb_perfcount.h +++ b/source3/include/smb_perfcount.h @@ -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_ */ diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index 3cd8e416107..1e2a7961d01 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -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: diff --git a/source3/smbd/smb1_process.c b/source3/smbd/smb1_process.c index 1834c67b91f..accda5368c4 100644 --- a/source3/smbd/smb1_process.c +++ b/source3/smbd/smb1_process.c @@ -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); diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index 7921d6b261b..ee4752ff526 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -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; } diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index f24c9d8f87b..e65a538692b 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -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: