diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/hash/extern.h | 2 | ||||
-rw-r--r-- | db/hash/hash.c | 10 | ||||
-rw-r--r-- | db/hash/hash.h | 2 | ||||
-rw-r--r-- | db/hash/hash_log2.c | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/db/hash/extern.h b/db/hash/extern.h index 3167e6d..4f1f23d 100644 --- a/db/hash/extern.h +++ b/db/hash/extern.h @@ -52,7 +52,7 @@ void __free_ovflpage __P((HTAB *, BUFHEAD *)); BUFHEAD *__get_buf __P((HTAB *, u_int32_t, BUFHEAD *, int)); int __get_page __P((HTAB *, char *, u_int32_t, int, int, int)); int __ibitmap __P((HTAB *, int, int, int)); -u_int32_t __log2 __P((u_int32_t)); +u_int32_t __hash_log2 __P((u_int32_t)); int __put_page __P((HTAB *, char *, u_int32_t, int, int)); void __reclaim_buf __P((HTAB *, BUFHEAD *)); int __split_page __P((HTAB *, u_int32_t, u_int32_t)); diff --git a/db/hash/hash.c b/db/hash/hash.c index db6fd69..08f2a7e 100644 --- a/db/hash/hash.c +++ b/db/hash/hash.c @@ -303,13 +303,13 @@ init_hash(hashp, file, info) if (stat(file, &statbuf)) return (NULL); hashp->BSIZE = statbuf.st_blksize; - hashp->BSHIFT = __log2(hashp->BSIZE); + hashp->BSHIFT = __hash_log2(hashp->BSIZE); } if (info) { if (info->bsize) { /* Round pagesize up to power of 2 */ - hashp->BSHIFT = __log2(info->bsize); + hashp->BSHIFT = __hash_log2(info->bsize); hashp->BSIZE = 1 << hashp->BSHIFT; if (hashp->BSIZE > MAX_BSIZE) { errno = EINVAL; @@ -358,7 +358,7 @@ init_htab(hashp, nelem) */ nelem = (nelem - 1) / hashp->FFACTOR + 1; - l2 = __log2(MAX(nelem, 2)); + l2 = __hash_log2(MAX(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; @@ -376,7 +376,7 @@ init_htab(hashp, nelem) hashp->BSHIFT) + 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; - nsegs = 1 << __log2(nsegs); + nsegs = 1 << __hash_log2(nsegs); if (nsegs > hashp->DSIZE) hashp->DSIZE = nsegs; @@ -843,7 +843,7 @@ __expand_table(hashp) * * increases), we need to copy the current contents of the spare * split bucket to the next bucket. */ - spare_ndx = __log2(hashp->MAX_BUCKET + 1); + spare_ndx = __hash_log2(hashp->MAX_BUCKET + 1); if (spare_ndx > hashp->OVFL_POINT) { hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT]; hashp->OVFL_POINT = spare_ndx; diff --git a/db/hash/hash.h b/db/hash/hash.h index 62176d7..d07db6f 100644 --- a/db/hash/hash.h +++ b/db/hash/hash.h @@ -170,7 +170,7 @@ typedef struct htab { /* Memory resident data structure */ #define OADDR_OF(S,O) ((u_int32_t)((u_int32_t)(S) << SPLITSHIFT) + (O)) #define BUCKET_TO_PAGE(B) \ - (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((B)+1)-1] : 0) + (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__hash_log2((B)+1)-1] : 0) #define OADDR_TO_PAGE(B) \ BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B)); diff --git a/db/hash/hash_log2.c b/db/hash/hash_log2.c index 92fda72..6bcf9c1 100644 --- a/db/hash/hash_log2.c +++ b/db/hash/hash_log2.c @@ -42,10 +42,10 @@ static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94"; #include <db.h> -u_int32_t __log2 __P((u_int32_t)); +u_int32_t __hash_log2 __P((u_int32_t)); u_int32_t -__log2(num) +__hash_log2(num) u_int32_t num; { register u_int32_t i, limit; |