*** 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;