~maria-captains/maria/xtradb-mergetree-5.5

« back to all changes in this revision

Viewing changes to include/buf0buf.ic

  • Committer: knielsen at knielsen-hq
  • Date: 2012-02-15 10:49:53 UTC
  • Revision ID: knielsen@knielsen-hq.org-20120215104953-wzcl57vil72bbmp1
Updated with XtraDB from Percona Server 5.5.20-24.1
Files copied from Percona-Server-5.5.20-rel24.1.tar.gz source tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
444
444
        case BUF_IO_NONE:
445
445
        case BUF_IO_READ:
446
446
        case BUF_IO_WRITE:
 
447
        case BUF_IO_PIN:
447
448
                return(io_fix);
448
449
        }
449
450
        ut_error;
494
495
        buf_page_set_io_fix(&block->page, io_fix);
495
496
}
496
497
 
 
498
/*********************************************************************//**
 
499
Makes a block sticky. A sticky block implies that even after we release
 
500
the buf_pool->mutex and the block->mutex:
 
501
* it cannot be removed from the flush_list
 
502
* the block descriptor cannot be relocated
 
503
* it cannot be removed from the LRU list
 
504
Note that:
 
505
* the block can still change its position in the LRU list
 
506
* the next and previous pointers can change. */
 
507
UNIV_INLINE
 
508
void
 
509
buf_page_set_sticky(
 
510
/*================*/
 
511
        buf_page_t*     bpage)  /*!< in/out: control block */
 
512
{
 
513
#ifdef UNIV_DEBUG
 
514
        buf_pool_t*     buf_pool = buf_pool_from_bpage(bpage);
 
515
        ut_ad(mutex_own(&buf_pool->LRU_list_mutex));
 
516
#endif
 
517
        ut_ad(mutex_own(buf_page_get_mutex(bpage)));
 
518
        ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_NONE);
 
519
 
 
520
        bpage->io_fix = BUF_IO_PIN;
 
521
}
 
522
 
 
523
/*********************************************************************//**
 
524
Removes stickiness of a block. */
 
525
UNIV_INLINE
 
526
void
 
527
buf_page_unset_sticky(
 
528
/*==================*/
 
529
        buf_page_t*     bpage)  /*!< in/out: control block */
 
530
{
 
531
#ifdef UNIV_DEBUG
 
532
        buf_pool_t*     buf_pool = buf_pool_from_bpage(bpage);
 
533
        ut_ad(mutex_own(&buf_pool->LRU_list_mutex));
 
534
#endif
 
535
        ut_ad(mutex_own(buf_page_get_mutex(bpage)));
 
536
        ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_PIN);
 
537
 
 
538
        bpage->io_fix = BUF_IO_NONE;
 
539
}
 
540
 
497
541
/********************************************************************//**
498
542
Determine if a buffer block can be relocated in memory.  The block
499
543
can be dirty, but it must not be I/O-fixed or bufferfixed. */