FreeBSD Bugzilla – Attachment 30353 Details for
Bug 51148
[patch] Control the cache size for pwd_mkdb(8) to speedup vipw
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.36 KB, created by
Alex Semenyaka
on 2003-04-19 05:30:11 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alex Semenyaka
Created:
2003-04-19 05:30:11 UTC
Size:
1.36 KB
patch
obsolete
>diff -r -u ../pwd_mkdb/pwd_mkdb.c ./pwd_mkdb.c >--- ../pwd_mkdb/pwd_mkdb.c Fri Jul 12 01:16:52 2002 >+++ ./pwd_mkdb.c Sat Apr 19 07:31:52 2003 >@@ -66,14 +66,17 @@ > #define SECURE 2 > #define PERM_INSECURE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) > #define PERM_SECURE (S_IRUSR|S_IWUSR) >+#define MINCACHE 2 >+#define MAXCACHE 16 >+#define CACHESZ_ENV "PWDB_CACHE" > > HASHINFO openinfo = { >- 4096, /* bsize */ >- 32, /* ffactor */ >- 256, /* nelem */ >- 2048 * 1024, /* cachesize */ >- NULL, /* hash() */ >- 0 /* lorder */ >+ 4096, /* bsize */ >+ 32, /* ffactor */ >+ 256, /* nelem */ >+ MINCACHE * 1024 * 1024, /* cachesize */ >+ NULL, /* hash() */ >+ 0 /* lorder */ > }; > > static enum state { FILE_INSECURE, FILE_SECURE, FILE_ORIG } clean; >@@ -101,6 +104,8 @@ > int ch, cnt, ypcnt, makeold, tfd, yp_enabled = 0; > unsigned int len; > int32_t pw_change, pw_expire; >+ int cache; >+ char *penv; > const char *t; > char *p; > char buf[MAX(MAXPATHLEN, LINE_MAX * 2)], tbuf[1024]; >@@ -116,6 +121,17 @@ > strcpy(prefix, _PATH_PWD); > makeold = 0; > username = NULL; >+ >+ penv = getenv(CACHESZ_ENV); >+ if (penv != NULL) { >+ cache = atoi(penv); >+ if (cache < MINCACHE) >+ cache = MINCACHE; >+ if (cache > MAXCACHE) >+ cache = MAXCACHE; >+ openinfo.cachesize = cache * 1024 * 1024; >+ } >+ > while ((ch = getopt(argc, argv, "Cd:ps:u:vN")) != -1) > switch(ch) { > case 'C': /* verify only */
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51148
: 30353