about summary refs log tree commit diff
path: root/db2/hash/hash.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-07 11:07:34 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-07 11:07:34 +0000
commit2c874db2dd8b34a36f00284c2c5d215a4c9506ac (patch)
tree679922799ac611eeff4513bfb7b0f880f1277b4f /db2/hash/hash.c
parent88c9111883a14f2f3fd31471df6923f76b97e1a0 (diff)
downloadglibc-2c874db2dd8b34a36f00284c2c5d215a4c9506ac.tar.gz
glibc-2c874db2dd8b34a36f00284c2c5d215a4c9506ac.tar.xz
glibc-2c874db2dd8b34a36f00284c2c5d215a4c9506ac.zip
Update.
	* db2/btree/bt_cursor.c: Likewise.
	* db2/common/db_region.db_c: Likewise.
	* db2/common/db_salloc.db_c: Likewise.
	* db2/db/db.c: Likewise.
	* db2/db/db_rec.c: Likewise.
	* db2/hash/hash.c: Likewise.
	* db2/hash/hash_page.c: Likewise.
	* db2/hash/hash_rec.c: Likewise.
	* db2/log/log_findckp.c: Likewise.
	* db2/log/log_get.c: Likewise.
	* db2/log/log_put.c: Likewise.
	* db2/mp/mp_fget.c: Likewise.
	* db2/mp/mp_fput.c: Likewise.
	* db2/mp/mp_region.c: Likewise.
Diffstat (limited to 'db2/hash/hash.c')
-rw-r--r--db2/hash/hash.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/db2/hash/hash.c b/db2/hash/hash.c
index 5e0660b727..0265f19659 100644
--- a/db2/hash/hash.c
+++ b/db2/hash/hash.c
@@ -359,11 +359,12 @@ __ham_get(dbp, txn, key, data, flags)
 
 	hashp->hash_accesses++;
 	hcp = (HASH_CURSOR *)TAILQ_FIRST(&ldbp->curs_queue)->internal;
-	if ((ret = __ham_lookup(hashp, hcp, key, 0, DB_LOCK_READ)) == 0)
+	if ((ret = __ham_lookup(hashp, hcp, key, 0, DB_LOCK_READ)) == 0) {
 		if (F_ISSET(hcp, H_OK))
 			ret = __ham_dup_return(hashp, hcp, data, DB_FIRST);
 		else /* Key was not found */
 			ret = DB_NOTFOUND;
+	}
 
 	if ((t_ret = __ham_item_done(hashp, hcp, 0)) != 0 && ret == 0)
 		ret = t_ret;
@@ -546,11 +547,12 @@ __ham_delete(dbp, txn, key, flags)
 	hcp = TAILQ_FIRST(&ldbp->curs_queue)->internal;
 
 	hashp->hash_accesses++;
-	if ((ret = __ham_lookup(hashp, hcp, key, 0, DB_LOCK_WRITE)) == 0)
+	if ((ret = __ham_lookup(hashp, hcp, key, 0, DB_LOCK_WRITE)) == 0) {
 		if (F_ISSET(hcp, H_OK))
 			ret = __ham_del_pair(hashp, hcp, 1);
 		else
 			ret = DB_NOTFOUND;
+	}
 
 	if ((t_ret = __ham_item_done(hashp, hcp, ret == 0)) != 0 && ret == 0)
 		ret = t_ret;
@@ -1109,7 +1111,7 @@ __ham_dup_return(hashp, hcp, val, flags)
 	 * duplicate.  In this case, we do initialization and then
 	 * let the normal duplicate code handle it.
 	 */
-	if (!F_ISSET(hcp, H_ISDUP))
+	if (!F_ISSET(hcp, H_ISDUP)) {
 		if (type == H_DUPLICATE) {
 			F_SET(hcp, H_ISDUP);
 			hcp->dup_tlen = LEN_HDATA(hcp->pagep,
@@ -1148,13 +1150,13 @@ __ham_dup_return(hashp, hcp, val, flags)
 			    hcp, pgno, 0, H_ISDUP)) != 0)
 				return (ret);
 		}
-
+	}
 
 	/*
 	 * Now, everything is initialized, grab a duplicate if
 	 * necessary.
 	 */
-	if (F_ISSET(hcp, H_ISDUP))
+	if (F_ISSET(hcp, H_ISDUP)) {
 		if (hcp->dpgno != PGNO_INVALID) {
 			pp = hcp->dpagep;
 			ndx = hcp->dndx;
@@ -1170,7 +1172,7 @@ __ham_dup_return(hashp, hcp, val, flags)
 			tmp_val.doff = hcp->dup_off + sizeof(db_indx_t);
 			myval = &tmp_val;
 		}
-
+	}
 
 	/*
 	 * Finally, if we had a duplicate, pp, ndx, and myval should be
@@ -1425,7 +1427,7 @@ __ham_c_update(hcp, chg_pgno, len, add, is_dup)
 				F_SET(lcp, H_DELETED);
 
 			/* Now adjust on-page information. */
-			if (lcp->dpgno == PGNO_INVALID)
+			if (lcp->dpgno == PGNO_INVALID) {
 				if (add) {
 					lcp->dup_tlen += len;
 					if (lcp->dndx > hcp->dndx)
@@ -1435,6 +1437,7 @@ __ham_c_update(hcp, chg_pgno, len, add, is_dup)
 					if (lcp->dndx > hcp->dndx)
 						lcp->dup_off -= len;
 				}
+			}
 		}
 	}
 	DB_THREAD_UNLOCK(hp->dbp);