summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 7df1c09fa0..7e2c25109a 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2158,6 +2158,7 @@ int reply_findclose(connection_struct *conn,
{
int outsize = 0;
int dptr_num=SVALS(inbuf,smb_vwv0);
+ START_PROFILE(SMBfindclose);
DEBUG(3,("reply_findclose, dptr_num = %d\n", dptr_num));
@@ -2167,6 +2168,7 @@ int reply_findclose(connection_struct *conn,
DEBUG(3,("SMBfindclose dptr_num = %d\n", dptr_num));
+ END_PROFILE(SMBfindclose);
return(outsize);
}
@@ -2178,6 +2180,7 @@ int reply_findnclose(connection_struct *conn,
{
int outsize = 0;
int dptr_num= -1;
+ START_PROFILE(SMBfindnclose);
dptr_num = SVAL(inbuf,smb_vwv0);
@@ -2191,6 +2194,7 @@ int reply_findnclose(connection_struct *conn,
DEBUG(3,("SMB_findnclose dptr_num = %d\n", dptr_num));
+ END_PROFILE(SMBfindnclose);
return(outsize);
}
@@ -2201,7 +2205,9 @@ int reply_findnclose(connection_struct *conn,
int reply_transs2(connection_struct *conn,
char *inbuf,char *outbuf,int length,int bufsize)
{
+ START_PROFILE(SMBtranss2);
DEBUG(4,("Ignoring transs2 of length %d\n",length));
+ END_PROFILE(SMBtranss2);
return(-1);
}
@@ -2226,6 +2232,7 @@ int reply_trans2(connection_struct *conn,
unsigned int tran_call = SVAL(inbuf, smb_setup0);
char *params = NULL, *data = NULL;
int num_params, num_params_sofar, num_data, num_data_sofar;
+ START_PROFILE(SMBtrans2);
if(global_oplock_break && (tran_call == TRANSACT2_OPEN)) {
/* Queue this open message as we are the process of an
@@ -2235,12 +2242,15 @@ int reply_trans2(connection_struct *conn,
DEBUGADD(2,( "in oplock break state.\n"));
push_oplock_pending_smb_message(inbuf, length);
+ END_PROFILE(SMBtrans2);
return -1;
}
if (IS_IPC(conn) && (tran_call != TRANSACT2_OPEN)
- && (tran_call != TRANSACT2_GET_DFS_REFERRAL))
+ && (tran_call != TRANSACT2_GET_DFS_REFERRAL)) {
+ END_PROFILE(SMBtrans2);
return(ERROR(ERRSRV,ERRaccess));
+ }
outsize = set_message(outbuf,0,0,True);
@@ -2248,6 +2258,7 @@ int reply_trans2(connection_struct *conn,
is so as a sanity check */
if (suwcnt != 1) {
DEBUG(2,("Invalid smb_sucnt in trans2 call\n"));
+ END_PROFILE(SMBtrans2);
return(ERROR(ERRSRV,ERRerror));
}
@@ -2259,10 +2270,11 @@ int reply_trans2(connection_struct *conn,
if ((total_params && !params) || (total_data && !data)) {
DEBUG(2,("Out of memory in reply_trans2\n"));
- if(params)
- free(params);
- if(data)
- free(data);
+ if(params)
+ free(params);
+ if(data)
+ free(data);
+ END_PROFILE(SMBtrans2);
return(ERROR(ERRDOS,ERRnomem));
}
@@ -2303,6 +2315,7 @@ int reply_trans2(connection_struct *conn,
free(params);
if(data)
free(data);
+ END_PROFILE(SMBtrans2);
return(ERROR(ERRSRV,ERRerror));
}
@@ -2330,67 +2343,89 @@ int reply_trans2(connection_struct *conn,
/* Now we must call the relevant TRANS2 function */
switch(tran_call) {
case TRANSACT2_OPEN:
+ START_PROFILE_NESTED(Trans2_open);
outsize = call_trans2open(conn,
inbuf, outbuf, bufsize,
&params, &data);
+ END_PROFILE_NESTED(Trans2_open);
break;
case TRANSACT2_FINDFIRST:
+ START_PROFILE_NESTED(Trans2_findfirst);
outsize = call_trans2findfirst(conn, inbuf, outbuf,
bufsize, &params, &data);
+ END_PROFILE_NESTED(Trans2_findfirst);
break;
case TRANSACT2_FINDNEXT:
+ START_PROFILE_NESTED(Trans2_findnext);
outsize = call_trans2findnext(conn, inbuf, outbuf,
length, bufsize,
&params, &data);
+ END_PROFILE_NESTED(Trans2_findnext);
break;
case TRANSACT2_QFSINFO:
+ START_PROFILE_NESTED(Trans2_qfsinfo);
outsize = call_trans2qfsinfo(conn, inbuf, outbuf,
length, bufsize, &params,
&data);
+ END_PROFILE_NESTED(Trans2_qfsinfo);
break;
case TRANSACT2_SETFSINFO:
+ START_PROFILE_NESTED(Trans2_setfsinfo);
outsize = call_trans2setfsinfo(conn, inbuf, outbuf,
length, bufsize,
&params, &data);
+ END_PROFILE_NESTED(Trans2_setfsinfo);
break;
case TRANSACT2_QPATHINFO:
case TRANSACT2_QFILEINFO:
+ START_PROFILE_NESTED(Trans2_qpathinfo);
outsize = call_trans2qfilepathinfo(conn, inbuf, outbuf,
length, bufsize,
&params, &data, total_data);
+ END_PROFILE_NESTED(Trans2_qpathinfo);
break;
case TRANSACT2_SETPATHINFO:
case TRANSACT2_SETFILEINFO:
+ START_PROFILE_NESTED(Trans2_setpathinfo);
outsize = call_trans2setfilepathinfo(conn, inbuf, outbuf,
length, bufsize,
&params, &data,
total_data);
+ END_PROFILE_NESTED(Trans2_setpathinfo);
break;
case TRANSACT2_FINDNOTIFYFIRST:
+ START_PROFILE_NESTED(Trans2_findnotifyfirst);
outsize = call_trans2findnotifyfirst(conn, inbuf, outbuf,
length, bufsize,
&params, &data);
+ END_PROFILE_NESTED(Trans2_findnotifyfirst);
break;
case TRANSACT2_FINDNOTIFYNEXT:
+ START_PROFILE_NESTED(Trans2_findnotifynext);
outsize = call_trans2findnotifynext(conn, inbuf, outbuf,
length, bufsize,
&params, &data);
+ END_PROFILE_NESTED(Trans2_findnotifynext);
break;
case TRANSACT2_MKDIR:
+ START_PROFILE_NESTED(Trans2_mkdir);
outsize = call_trans2mkdir(conn, inbuf, outbuf, length,
bufsize, &params, &data);
+ END_PROFILE_NESTED(Trans2_mkdir);
break;
case TRANSACT2_GET_DFS_REFERRAL:
+ START_PROFILE_NESTED(Trans2_get_dfs_referral);
outsize = call_trans2getdfsreferral(conn,inbuf,outbuf,length,
bufsize, &params, &data);
+ END_PROFILE_NESTED(Trans2_get_dfs_referral);
break;
default:
/* Error in request */
@@ -2399,6 +2434,7 @@ int reply_trans2(connection_struct *conn,
free(params);
if(data)
free(data);
+ END_PROFILE(SMBtrans2);
return (ERROR(ERRSRV,ERRerror));
}
@@ -2413,6 +2449,7 @@ int reply_trans2(connection_struct *conn,
free(params);
if(data)
free(data);
+ END_PROFILE(SMBtrans2);
return outsize; /* If a correct response was needed the
call_trans2xxx calls have already sent
it. If outsize != -1 then it is returning */