diff options
author | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
commit | 02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch) | |
tree | 61b9147863cd8be3eff63903dc36cae168254bd5 /src/plugins/kdb/db2/libdb2/hash | |
parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
download | krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.bz2 |
make mark-cstyle
make reindent
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins/kdb/db2/libdb2/hash')
-rw-r--r-- | src/plugins/kdb/db2/libdb2/hash/hash.c | 16 | ||||
-rw-r--r-- | src/plugins/kdb/db2/libdb2/hash/hash.h | 2 | ||||
-rw-r--r-- | src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c | 2 | ||||
-rw-r--r-- | src/plugins/kdb/db2/libdb2/hash/hash_page.c | 28 | ||||
-rw-r--r-- | src/plugins/kdb/db2/libdb2/hash/page.h | 4 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c index c1a6608..2343d22 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash.c @@ -428,7 +428,7 @@ hget_header(hashp, page_size) hdr_dest = (u_int8_t *)&hashp->hdr; - /* + /* * XXX * This should not be printing to stderr on a "normal" error case. */ @@ -514,14 +514,14 @@ hdestroy(hashp) free(hashp->bigkey_buf); if (hashp->bigdata_buf) free(hashp->bigdata_buf); - + /* XXX This should really iterate over the cursor queue, but it's not clear how to do that, and the only cursor a hash table ever creates is the one used by hash_seq(). Passing NULL as the first arg is also a kludge, but I know that it's never used, so I do it. The intent is to plug the memory leak. Correctness can come later. */ - + if (hashp->seq_cursor) hashp->seq_cursor->delete(NULL, hashp->seq_cursor, 0); @@ -532,7 +532,7 @@ hdestroy(hashp) if (hashp->fp != -1) (void)close(hashp->fp); - /* + /* * *** This may cause problems if hashp->fname is set in any case * other than the case that we are generating a temporary file name. * Note that the new version of mpool should support temporary @@ -704,7 +704,7 @@ hash_access(hashp, action, key, val) num_items = 0; - /* + /* * Set up item_info so that we're looking for space to add an item * as we cycle through the pages looking for the key. */ @@ -868,7 +868,7 @@ cursor_get(dbp, cursorp, key, val, flags) /* * This needs to be changed around. As is, get_item_next advances * the pointers on the page but this function actually advances - * bucket pointers. This works, since the only other place we + * bucket pointers. This works, since the only other place we * use get_item_next is in hash_access which only deals with one * bucket at a time. However, there is the problem that certain other * functions (such as find_bigpair and delpair) depend on the @@ -920,7 +920,7 @@ cursor_delete(dbp, cursor, flags) /* XXX this is empirically determined, so it might not be completely correct, but it seems to work. At the very least it fixes a memory leak */ - + free(cursor->internal); free(cursor); @@ -937,7 +937,7 @@ hash_seq(dbp, key, val, flag) /* * Seq just uses the default cursor to go sequecing through the - * database. Note that the default cursor is the first in the list. + * database. Note that the default cursor is the first in the list. */ hashp = (HTAB *)dbp->internal; diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.h b/src/plugins/kdb/db2/libdb2/hash/hash.h index b202fc9..32793ca 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.h +++ b/src/plugins/kdb/db2/libdb2/hash/hash.h @@ -193,4 +193,4 @@ typedef struct item_info { #define ITEM_GET_N 4 #define UNKNOWN 0xffffffff /* for num_items */ -#define NO_EXPAND 0xfffffffe +#define NO_EXPAND 0xfffffffe diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c index 06210a5..6874f47 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c @@ -75,7 +75,7 @@ static int32_t collect_data __P((HTAB *, PAGE16 *, int32_t)); /* * Big_insert * - * You need to do an insert and the key/data pair is greater than + * You need to do an insert and the key/data pair is greater than * MINFILL * the bucket size * * Returns: diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c index e25115d..f27e7dd 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c @@ -102,7 +102,7 @@ __get_item(hashp, cursorp, key, val, item_info) cursorp->pgno = ADDR(cursorp->pagep); cursorp->ndx = 0; cursorp->pgndx = 0; - } else + } else cursorp->pagep = __get_page(hashp, cursorp->pgno, A_RAW); if (!cursorp->pagep) { @@ -140,7 +140,7 @@ __get_item(hashp, cursorp, key, val, item_info) KEY_OFF(cursorp->pagep, cursorp->pgndx); } - /* + /* * All of this information will be set incorrectly for big keys, but * it will be ignored anyway. */ @@ -183,7 +183,7 @@ __get_item_done(hashp, cursorp) __put_page(hashp, cursorp->pagep, A_RAW, 0); cursorp->pagep = NULL; - /* + /* * We don't throw out the page number since we might want to * continue getting on this page. */ @@ -354,7 +354,7 @@ __delpair(hashp, cursorp, item_info) * item on the page. */ src = (u_int8_t *)pagep + OFFSET(pagep) + 1; - /* + /* * Length is the distance between where to start * deleting and end of the data on the page. */ @@ -399,7 +399,7 @@ __delpair(hashp, cursorp, item_info) db_pgno_t to_find, next_pgno, link_page; /* - * We need to go back to the first page in the chain and + * We need to go back to the first page in the chain and * look for this page so that we can update the previous * page's NEXT_PGNO field. */ @@ -511,7 +511,7 @@ __split_page(hashp, obucket, nbucket) } /* - * Add the given pair to the page. + * Add the given pair to the page. * * * Returns: @@ -545,7 +545,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) /* Advance to first page in chain with room for item. */ while (NUM_ENT(pagep) && NEXT_PGNO(pagep) != INVALID_PGNO) { - /* + /* * This may not be the end of the chain, but the pair may fit * anyway. */ @@ -577,9 +577,9 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (-1); } } - + /* At this point, we know the page fits, so we just add it */ - + if (ISBIG(PAIRSIZE(key, val), hashp)) { if (__big_insert(hashp, pagep, key, val)) return (-1); @@ -624,7 +624,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (0); } -/* +/* * Special __addel used in big splitting; this one just puts the pointer * to an already-allocated big page in the appropriate bucket. */ @@ -866,8 +866,8 @@ __pgin_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 0) New page that may be unitialized. * 1) Bucket page or overflow page. Either swap * the header or initialize the page. @@ -906,8 +906,8 @@ __pgout_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 1) Bucket page or overflow page. Just swap the header. * 2) Bitmap page. Swap the whole page! * 3) Header pages. Not handled here; these are written directly diff --git a/src/plugins/kdb/db2/libdb2/hash/page.h b/src/plugins/kdb/db2/libdb2/hash/page.h index 8ef8a2e..989f967 100644 --- a/src/plugins/kdb/db2/libdb2/hash/page.h +++ b/src/plugins/kdb/db2/libdb2/hash/page.h @@ -57,7 +57,7 @@ * other (since we use that fact to compute key lengths). In the accessor * macros below, P means a pointer to the page, I means an index of the * particular entry being accessed. - * + * * Hash base page format * BYTE ITEM NBYTES TYPE ACCESSOR MACRO * ---- ------------------ ------ -------- -------------- @@ -167,7 +167,7 @@ typedef unsigned char PAGE8; #define FREESPACE(P) \ ((OFFSET((P)) + 1 - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD))) -/* +/* * Overhead on header pages is just one word -- the length of the * header info stored on that page. */ |