summaryrefslogtreecommitdiff
path: root/databases/db41/files/patch-upstream.4.1.25.3
blob: f31ebfdf1fb500c9c2b105529c026e7e6cb997b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
*** ../mp/mp_fget.c.orig	2002-08-07 08:23:01.000000000 -0700
--- ../mp/mp_fget.c	2006-05-30 20:32:20.000000000 -0700
***************
*** 506,513 ****
  	 */
  	if (state != SECOND_MISS && bhp->ref == 1) {
  		bhp->priority = UINT32_T_MAX;
! 		SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
! 		SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
  		hp->hash_priority =
  		    SH_TAILQ_FIRST(&hp->hash_bucket, __bh)->priority;
  	}
--- 506,517 ----
  	 */
  	if (state != SECOND_MISS && bhp->ref == 1) {
  		bhp->priority = UINT32_T_MAX;
! 		/* Move the buffer if there are others in the bucket. */
! 		if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) != bhp
! 		    || SH_TAILQ_NEXT(bhp, hq, __bh) != NULL) {
! 			SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
! 			SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
! 		}
  		hp->hash_priority =
  		    SH_TAILQ_FIRST(&hp->hash_bucket, __bh)->priority;
  	}
*** ../mp/mp_fput.c.orig	2002-08-13 06:26:41.000000000 -0700
--- ../mp/mp_fput.c	2006-05-30 20:55:11.000000000 -0700
***************
*** 166,171 ****
--- 166,176 ----
  	 * to the correct position in the list.
  	 */
  	argbhp = bhp;
+ 	/* Move the buffer if there are others in the bucket. */
+ 	if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) == bhp
+ 	    && SH_TAILQ_NEXT(bhp, hq, __bh) != NULL)
+ 	    	goto done;
+ 
  	SH_TAILQ_REMOVE(&hp->hash_bucket, argbhp, hq, __bh);
  
  	prev = NULL;
***************
*** 178,183 ****
--- 183,189 ----
  	else
  		SH_TAILQ_INSERT_AFTER(&hp->hash_bucket, prev, argbhp, hq, __bh);
  
+ done:
  	/* Reset the hash bucket's priority. */
  	hp->hash_priority = SH_TAILQ_FIRST(&hp->hash_bucket, __bh)->priority;