1
- /* Copyright (c) 2006, 2015 , Oracle and/or its affiliates. All rights reserved.
1
+ /* Copyright (c) 2006, 2016 , Oracle and/or its affiliates. All rights reserved.
2
2
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
@@ -45,7 +45,7 @@ const int LF_HASH_OVERHEAD= sizeof(LF_SLIST);
45
45
46
46
/*
47
47
a structure to pass the context (pointers two the three successive elements
48
- in a list) from lfind to linsert/ldelete
48
+ in a list) from my_lfind to linsert/ldelete
49
49
*/
50
50
typedef struct {
51
51
intptr volatile * prev ;
@@ -72,7 +72,7 @@ typedef struct {
72
72
cursor is positioned in either case
73
73
pins[0..2] are used, they are NOT removed on return
74
74
*/
75
- static int lfind (LF_SLIST * volatile * head , CHARSET_INFO * cs , uint32 hashnr ,
75
+ static int my_lfind (LF_SLIST * volatile * head , CHARSET_INFO * cs , uint32 hashnr ,
76
76
const uchar * key , uint keylen , CURSOR * cursor , LF_PINS * pins )
77
77
{
78
78
uint32 cur_hashnr ;
@@ -140,7 +140,7 @@ static int lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
140
140
/*
141
141
DESCRIPTION
142
142
insert a 'node' in the list that starts from 'head' in the correct
143
- position (as found by lfind )
143
+ position (as found by my_lfind )
144
144
145
145
RETURN
146
146
0 - inserted
@@ -158,7 +158,7 @@ static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
158
158
159
159
for (;;)
160
160
{
161
- if (lfind (head , cs , node -> hashnr , node -> key , node -> keylen ,
161
+ if (my_lfind (head , cs , node -> hashnr , node -> key , node -> keylen ,
162
162
& cursor , pins ) &&
163
163
(flags & LF_HASH_UNIQUE ))
164
164
{
@@ -209,7 +209,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
209
209
210
210
for (;;)
211
211
{
212
- if (!lfind (head , cs , hashnr , key , keylen , & cursor , pins ))
212
+ if (!my_lfind (head , cs , hashnr , key , keylen , & cursor , pins ))
213
213
{
214
214
res = 1 ; /* not found */
215
215
break ;
@@ -233,7 +233,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
233
233
(to ensure the number of "set DELETED flag" actions
234
234
is equal to the number of "remove from the list" actions)
235
235
*/
236
- lfind (head , cs , hashnr , key , keylen , & cursor , pins );
236
+ my_lfind (head , cs , hashnr , key , keylen , & cursor , pins );
237
237
}
238
238
res = 0 ;
239
239
break ;
@@ -259,12 +259,12 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
259
259
it uses pins[0..2], on return the pin[2] keeps the node found
260
260
all other pins are removed.
261
261
*/
262
- static LF_SLIST * lsearch (LF_SLIST * volatile * head , CHARSET_INFO * cs ,
262
+ static LF_SLIST * my_lsearch (LF_SLIST * volatile * head , CHARSET_INFO * cs ,
263
263
uint32 hashnr , const uchar * key , uint keylen ,
264
264
LF_PINS * pins )
265
265
{
266
266
CURSOR cursor ;
267
- int res = lfind (head , cs , hashnr , key , keylen , & cursor , pins );
267
+ int res = my_lfind (head , cs , hashnr , key , keylen , & cursor , pins );
268
268
if (res )
269
269
_lf_pin (pins , 2 , cursor .curr );
270
270
_lf_unpin (pins , 0 );
@@ -445,7 +445,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
445
445
MY_ERRPTR if OOM
446
446
447
447
NOTE
448
- see lsearch () for pin usage notes
448
+ see my_lsearch () for pin usage notes
449
449
*/
450
450
void * lf_hash_search (LF_HASH * hash , LF_PINS * pins , const void * key , uint keylen )
451
451
{
@@ -459,7 +459,7 @@ void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
459
459
return MY_ERRPTR ;
460
460
if (* el == NULL && unlikely (initialize_bucket (hash , el , bucket , pins )))
461
461
return MY_ERRPTR ;
462
- found = lsearch (el , hash -> charset , my_reverse_bits (hashnr ) | 1 ,
462
+ found = my_lsearch (el , hash -> charset , my_reverse_bits (hashnr ) | 1 ,
463
463
(uchar * )key , keylen , pins );
464
464
lf_rwunlock_by_pins (pins );
465
465
return found ? found + 1 : 0 ;
0 commit comments