xref: /freebsd/crypto/krb5/src/plugins/kdb/db2/libdb2/hash/hash.c.patch (revision 24e4dcf4ba5e9dedcf89efd358ea3e1fe5867020)
1*** /tmp/,RCSt1a21714	Wed Apr  3 11:49:15 1996
2--- hash.c	Wed Apr  3 08:43:04 1996
3***************
4*** 399,405
5  	/* Create pages for these buckets */
6  	/*
7  	for (i = 0; i <= hashp->hdr.max_bucket; i++) {
8! 		if (__new_page(hashp, i, A_BUCKET) != 0)
9  			return (-1);
10  	}
11  	*/
12
13--- 399,405 -----
14  	/* Create pages for these buckets */
15  	/*
16  	for (i = 0; i <= hashp->hdr.max_bucket; i++) {
17! 		if (__new_page(hashp, (u_int32_t)i, A_BUCKET) != 0)
18  			return (-1);
19  	}
20  	*/
21***************
22*** 560,567
23  	 * XXX
24  	 * Check success/failure conditions.
25  	 */
26! 	mpool_sync(hashp->mp);
27! 	return (0);
28  }
29
30  /*
31
32--- 560,566 -----
33  	 * XXX
34  	 * Check success/failure conditions.
35  	 */
36! 	return (flush_meta(hashp) || mpool_sync(hashp->mp));
37  }
38
39  /*
40***************
41*** 585,591
42  	hput_header(hashp);
43
44  	for (i = 0; i < NCACHED; i++)
45! 		if (hashp->mapp[i])
46  			if (__put_page(hashp,
47  			    (PAGE16 *)hashp->mapp[i], A_BITMAP, 1))
48  				return (-1);
49
50--- 584,590 -----
51  	hput_header(hashp);
52
53  	for (i = 0; i < NCACHED; i++)
54! 		if (hashp->mapp[i]) {
55  			if (__put_page(hashp,
56  			    (PAGE16 *)hashp->mapp[i], A_BITMAP, 1))
57  				return (-1);
58***************
59*** 589,594
60  			if (__put_page(hashp,
61  			    (PAGE16 *)hashp->mapp[i], A_BITMAP, 1))
62  				return (-1);
63  	return (0);
64  }
65
66
67--- 588,595 -----
68  			if (__put_page(hashp,
69  			    (PAGE16 *)hashp->mapp[i], A_BITMAP, 1))
70  				return (-1);
71+ 			hashp->mapp[i] = NULL;
72+ 		}
73  	return (0);
74  }
75
76***************
77*** 726,732
78  #ifdef HASH_STATISTICS
79  	hash_collisions++;
80  #endif
81-
82  	__get_item_done(hashp, &cursor);
83
84  	/*
85
86--- 727,732 -----
87  #ifdef HASH_STATISTICS
88  	hash_collisions++;
89  #endif
90  	__get_item_done(hashp, &cursor);
91
92  	/*
93***************
94*** 773,778
95  		if (__delpair(hashp, &cursor, &item_info) ||
96  		    __addel(hashp, &item_info, key, val, UNKNOWN, 0))
97  			return (ERROR);
98  		if (item_info.caused_expand)
99  			__expand_table(hashp);
100  		break;
101
102--- 773,779 -----
103  		if (__delpair(hashp, &cursor, &item_info) ||
104  		    __addel(hashp, &item_info, key, val, UNKNOWN, 0))
105  			return (ERROR);
106+ 		__get_item_done(hashp, &cursor);
107  		if (item_info.caused_expand)
108  			__expand_table(hashp);
109  		break;
110