The Samba-Bugzilla – Attachment 3804 Details for
Bug 5955
Windbind becomes unresponsive when load on winbind is high
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to speed up fill_grent_mem()
fill_grent_mem.patch (text/plain), 1.75 KB, created by
Michael Adam
on 2008-12-09 10:15:10 UTC
(
hide
)
Description:
patch to speed up fill_grent_mem()
Filename:
MIME Type:
Creator:
Michael Adam
Created:
2008-12-09 10:15:10 UTC
Size:
1.75 KB
patch
obsolete
> source/winbindd/winbindd_group.c | 35 +++++++++++++++++++++-------------- > 1 files changed, 21 insertions(+), 14 deletions(-) > >diff --git a/source/winbindd/winbindd_group.c b/source/winbindd/winbindd_group.c >index f81caa2..66d2634 100644 >--- a/source/winbindd/winbindd_group.c >+++ b/source/winbindd/winbindd_group.c >@@ -331,6 +331,24 @@ static int namecmp( const void *a, const void *b ) > return StrCaseCmp( * (char * const *) a, * (char * const *) b); > } > >+static void sort_unique_list(char ***list, uint32 *n_list) >+{ >+ uint32_t i; >+ >+ /* search for duplicates for sorting and looking for matching >+ neighbors */ >+ >+ qsort(*list, *n_list, sizeof(char*), QSORT_CAST namecmp); >+ >+ for (i=1; i < *n_list; i++) { >+ if (strcmp((*list)[i-1], (*list)[i]) == 0) { >+ memmove(&((*list)[i-1]), &((*list)[i]), >+ sizeof(char*)*((*n_list)-i)); >+ (*n_list)--; >+ } >+ } >+} >+ > static NTSTATUS add_names_to_list( TALLOC_CTX *ctx, > char ***list, uint32 *n_list, > char **names, uint32 n_names ) >@@ -362,19 +380,6 @@ static NTSTATUS add_names_to_list( TALLOC_CTX *ctx, > new_list[i] = talloc_strdup( new_list, names[j] ); > } > >- /* search for duplicates for sorting and looking for matching >- neighbors */ >- >- qsort( new_list, n_new_list, sizeof(char*), QSORT_CAST namecmp ); >- >- for ( i=1; i<n_new_list; i++ ) { >- if ( strcmp( new_list[i-1], new_list[i] ) == 0 ) { >- memmove( &new_list[i-1], &new_list[i], >- sizeof(char*)*(n_new_list-i) ); >- n_new_list--; >- } >- } >- > *list = new_list; > *n_list = n_new_list; > >@@ -576,7 +581,9 @@ static bool fill_grent_mem(struct winbindd_domain *domain, > n_glist = n_new_glist; > } > TALLOC_FREE( glist ); >- >+ >+ sort_unique_list(&names, &num_names); >+ > DEBUG(10, ("looked up %d names\n", num_names)); > > again:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5955
:
3797
|
3798
|
3799
|
3800
|
3801
|
3802
| 3804