summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_pipe_hnd.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-17 06:47:53 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-17 06:47:53 +0000
commit72ed7049d88e5296ebec362189e62a384385ad34 (patch)
tree4609523acc63ae3e14201b49a4b9c47d1ec8e4d6 /source3/rpc_server/srv_pipe_hnd.c
parent69c6f1624d79e4cf4296856d66216cca90863286 (diff)
downloadsamba-72ed7049d88e5296ebec362189e62a384385ad34.tar.gz
samba-72ed7049d88e5296ebec362189e62a384385ad34.tar.bz2
samba-72ed7049d88e5296ebec362189e62a384385ad34.zip
added some optimisation for the case where the number of open files is
very large. files.c now promotes a files_struct to the top of the list if it is used when it is more than 10 elements from the top. also moved common linked list code for the 5 sets of linked lists that I've created over the past few days into dlinklist.h (I've explained to Chris why I didn't use the ubiqx code) (This used to be commit 1eb9ae2996b5a243a147f485e7e353d54f820852)
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 368bf013a0..b030ee0e90 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -91,14 +91,7 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name,
p = (pipes_struct *)malloc(sizeof(*p));
if (!p) return NULL;
- /* hook into the front of the list */
- if (!Pipes) {
- Pipes = p;
- } else {
- Pipes->prev = p;
- p->next = Pipes;
- Pipes = p;
- }
+ DLIST_ADD(Pipes, p);
bitmap_set(bmap, i);
i += PIPE_HANDLE_OFFSET;
@@ -292,13 +285,7 @@ BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn)
DEBUG(4,("closed pipe name %s pnum=%x (pipes_open=%d)\n",
p->name, p->pnum, pipes_open));
- if (p == Pipes) {
- Pipes = p->next;
- if (Pipes) Pipes->prev = NULL;
- } else {
- p->prev->next = p->next;
- if (p->next) p->next->prev = p->prev;
- }
+ DLIST_REMOVE(Pipes, p);
memset(p, 0, sizeof(*p));