diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-02-13 20:36:37 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-02-13 20:36:37 +0000 |
commit | 20e498bdb0608ae6ca431cb49d66d2ed6f5304f5 (patch) | |
tree | 55ff7b1aeaaefd6e82c5370ed0fdd91673cd92e5 /nscd/nscd.h | |
parent | d8111eac5422eded7a8680ca198eb5d149a38550 (diff) | |
download | glibc-20e498bdb0608ae6ca431cb49d66d2ed6f5304f5.tar.gz glibc-20e498bdb0608ae6ca431cb49d66d2ed6f5304f5.tar.xz glibc-20e498bdb0608ae6ca431cb49d66d2ed6f5304f5.zip |
[BZ #5381]
2009-02-13 Ulrich Drepper <drepper@redhat.com> [BZ #5381] * nscd/nscd.h: Remove definitions and declarations for mem_in_flight. Change mempool_alloc prototype. * nscd/mem.c (gc): Don't handle mem_in_flight. (mempool_alloc): Third parameter now only indicates whether this is the first call (to allocate data) or not. If it is, get db rdlock. Release it on error. Don't handle mem_in_flight. * nscd/aicache.c (addhstaiX): Mark he parameter as const. Adjust third parameter of mempool_alloc calls. Nothing to do here in case mempool_alloc fails. Avoid local variable shadowing parameter. No need to get db rdlock before calling cache_add. * nscd/cache.c (cache_add): Adjust call to mempool_alloc. There is no mem_in_flight array anymore. * nscd/connections.c: Remove definition and handling of mem_in_flight. * nscd/grpcache.c (cache_addgr): Adjust third parameter of mempool_alloc calls. Mark he parameter as const. Nothing to do here in case mempool_alloc fails. No need to get db rdlock before calling cache_add. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nscd/servicescache.c (cache_addserv): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. Remove some debugging code.
Diffstat (limited to 'nscd/nscd.h')
-rw-r--r-- | nscd/nscd.h | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/nscd/nscd.h b/nscd/nscd.h index 2d77bab989..3279b85432 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -1,5 +1,4 @@ -/* Copyright (c) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008 - Free Software Foundation, Inc. +/* Copyright (c) 1998-2001, 2003-2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. @@ -184,31 +183,6 @@ extern uid_t old_uid; extern gid_t old_gid; -/* Memory allocation in flight. Each thread can have a limited number - of allocation in flight. No need to create dynamic data - structures. We use fixed indices. */ -enum in_flight - { - IDX_result_data = 0, - /* Keep the IDX_record_data entry last at all times. */ - IDX_record_data = 1, - IDX_last - }; -extern __thread struct mem_in_flight -{ - struct - { - int dbidx; - nscd_ssize_t blocklen; - nscd_ssize_t blockoff; - } block[IDX_last]; - - struct mem_in_flight *next; -} mem_in_flight attribute_tls_model_ie; -/* Global list of the mem_in_flight variables of all the threads. */ -extern struct mem_in_flight *mem_in_flight_list; - - /* Prototypes for global functions. */ /* nscd.c */ @@ -301,7 +275,7 @@ extern void readdservbyport (struct database_dyn *db, struct hashentry *he, /* mem.c */ extern void *mempool_alloc (struct database_dyn *db, size_t len, - enum in_flight idx); + int data_alloc); extern void gc (struct database_dyn *db); |