diff options
author | James Peach <jpeach@samba.org> | 2006-05-05 07:15:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:47 -0500 |
commit | 4d55a81958a67d5da3227d7af79a5c630f678424 (patch) | |
tree | 7f442d39615b6a1893423355ec71184abe58384b /source3/smbd/nttrans.c | |
parent | ea069fcf0193cb359cec7e69548d08d069d641da (diff) | |
download | samba-4d55a81958a67d5da3227d7af79a5c630f678424.tar.gz samba-4d55a81958a67d5da3227d7af79a5c630f678424.tar.bz2 samba-4d55a81958a67d5da3227d7af79a5c630f678424.zip |
r15450: Change profiling data macros to use stack variables rather than
globals. This catches mismatched start/end calls and removes
the need for special nested profiling calls.
(This used to be commit ee750498812190edd3ec52ca3c750258f3b8a97a)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 96e2c18bc0..3cdc4997b2 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -2719,6 +2719,7 @@ static int handle_nttrans(connection_struct *conn, /* Now we must call the relevant NT_TRANS function */ switch(state->call) { case NT_TRANSACT_CREATE: + { START_PROFILE_NESTED(NT_transact_create); outsize = call_nt_transact_create(conn, inbuf, outbuf, size, bufsize, @@ -2728,7 +2729,10 @@ static int handle_nttrans(connection_struct *conn, state->max_data_return); END_PROFILE_NESTED(NT_transact_create); break; + } + case NT_TRANSACT_IOCTL: + { START_PROFILE_NESTED(NT_transact_ioctl); outsize = call_nt_transact_ioctl(conn, inbuf, outbuf, size, bufsize, @@ -2737,7 +2741,10 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_ioctl); break; + } + case NT_TRANSACT_SET_SECURITY_DESC: + { START_PROFILE_NESTED(NT_transact_set_security_desc); outsize = call_nt_transact_set_security_desc(conn, inbuf, outbuf, size, bufsize, @@ -2746,7 +2753,10 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_set_security_desc); break; + } + case NT_TRANSACT_NOTIFY_CHANGE: + { START_PROFILE_NESTED(NT_transact_notify_change); outsize = call_nt_transact_notify_change(conn, inbuf, outbuf, size, bufsize, @@ -2755,7 +2765,10 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_notify_change); break; + } + case NT_TRANSACT_RENAME: + { START_PROFILE_NESTED(NT_transact_rename); outsize = call_nt_transact_rename(conn, inbuf, outbuf, size, bufsize, @@ -2764,8 +2777,10 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_rename); break; + } case NT_TRANSACT_QUERY_SECURITY_DESC: + { START_PROFILE_NESTED(NT_transact_query_security_desc); outsize = call_nt_transact_query_security_desc(conn, inbuf, outbuf, size, bufsize, @@ -2774,8 +2789,11 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_query_security_desc); break; + } + #ifdef HAVE_SYS_QUOTAS case NT_TRANSACT_GET_USER_QUOTA: + { START_PROFILE_NESTED(NT_transact_get_user_quota); outsize = call_nt_transact_get_user_quota(conn, inbuf, outbuf, size, bufsize, @@ -2784,7 +2802,10 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_get_user_quota); break; + } + case NT_TRANSACT_SET_USER_QUOTA: + { START_PROFILE_NESTED(NT_transact_set_user_quota); outsize = call_nt_transact_set_user_quota(conn, inbuf, outbuf, size, bufsize, @@ -2793,7 +2814,9 @@ static int handle_nttrans(connection_struct *conn, &state->data, state->total_data, state->max_data_return); END_PROFILE_NESTED(NT_transact_set_user_quota); break; + } #endif /* HAVE_SYS_QUOTAS */ + default: /* Error in request */ DEBUG(0,("reply_nttrans: Unknown request %d in nttrans call\n", @@ -2881,7 +2904,7 @@ int reply_nttrans(connection_struct *conn, DEBUG(0,("reply_nttrans: data malloc fail for %u " "bytes !\n", state->total_data)); TALLOC_FREE(state); - END_PROFILE(SMBtrans); + END_PROFILE(SMBnttrans); return(ERROR_DOS(ERRDOS,ERRnomem)); } if ((dsoff+dscnt < dsoff) || (dsoff+dscnt < dscnt)) @@ -2901,7 +2924,7 @@ int reply_nttrans(connection_struct *conn, "bytes !\n", state->total_param)); SAFE_FREE(state->data); TALLOC_FREE(state); - END_PROFILE(SMBtrans); + END_PROFILE(SMBnttrans); return(ERROR_DOS(ERRDOS,ERRnomem)); } if ((psoff+pscnt < psoff) || (psoff+pscnt < pscnt)) |