summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-11 14:07:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:53 -0500
commitfe881c3e38bb25a6716d94df362a5580afbdfd8b (patch)
treee536b2172b8412bb39ac4314ede8d677a49c3f43 /source3/smbd/process.c
parent4f5cfc9899295a5c14f734a6c92b3c902ff738d6 (diff)
downloadsamba-fe881c3e38bb25a6716d94df362a5580afbdfd8b.tar.gz
samba-fe881c3e38bb25a6716d94df362a5580afbdfd8b.tar.bz2
samba-fe881c3e38bb25a6716d94df362a5580afbdfd8b.zip
r21278: The main goal of this was to get rid of the NetInBuffer / set_InBuffer. But it
turns out that this patch actually speeds up the async writes considerably. I tested writing 100.000 times 65535 bytes with the allowed 10 ops in parallel. Without this patch it took about 32 seconds on my dual-core 1.6GHz laptop. With this patch it dropped to about 26 seconds. I can only explain it by better cache locality, NewInBuffer allocates more than 128k, so we jump around in memory more. Jeremy, please check! Volker (This used to be commit 452d51bc6fd41771b9c41ba6391664513d7cf2cd)
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 6a6da8715f..a0e14d8445 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1463,54 +1463,18 @@ char *get_InBuffer(void)
return InBuffer;
}
-void set_InBuffer(char *new_inbuf)
-{
- InBuffer = new_inbuf;
- current_inbuf = InBuffer;
-}
-
char *get_OutBuffer(void)
{
return OutBuffer;
}
-void set_OutBuffer(char *new_outbuf)
-{
- OutBuffer = new_outbuf;
-}
-
-/****************************************************************************
- Free an InBuffer. Checks if not in use by aio system.
- Must have been allocated by NewInBuffer.
-****************************************************************************/
-
-void free_InBuffer(char *inbuf)
-{
- if (!aio_inbuffer_in_use(inbuf)) {
- if (current_inbuf == inbuf) {
- current_inbuf = NULL;
- }
- SAFE_FREE(inbuf);
- }
-}
-
-/****************************************************************************
- Free an OutBuffer. No outbuffers currently stolen by aio system.
- Must have been allocated by NewInBuffer.
-****************************************************************************/
-
-void free_OutBuffer(char *outbuf)
-{
- SAFE_FREE(outbuf);
-}
-
const int total_buffer_size = (BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE + SAFETY_MARGIN);
/****************************************************************************
Allocate a new InBuffer. Returns the new and old ones.
****************************************************************************/
-char *NewInBuffer(char **old_inbuf)
+static char *NewInBuffer(char **old_inbuf)
{
char *new_inbuf = (char *)SMB_MALLOC(total_buffer_size);
if (!new_inbuf) {
@@ -1530,7 +1494,7 @@ char *NewInBuffer(char **old_inbuf)
Allocate a new OutBuffer. Returns the new and old ones.
****************************************************************************/
-char *NewOutBuffer(char **old_outbuf)
+static char *NewOutBuffer(char **old_outbuf)
{
char *new_outbuf = (char *)SMB_MALLOC(total_buffer_size);
if (!new_outbuf) {