~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to storage/innobase/include/buf0buf.ic

  • Committer: Clint Byrum
  • Date: 2012-02-15 01:24:19 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: clint@ubuntu.com-20120215012419-upaezkp5ynk787ki
ImportĀ upstreamĀ versionĀ 5.5.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
414
414
        case BUF_IO_NONE:
415
415
        case BUF_IO_READ:
416
416
        case BUF_IO_WRITE:
 
417
        case BUF_IO_PIN:
417
418
                return(io_fix);
418
419
        }
419
420
        ut_error;
464
465
        buf_page_set_io_fix(&block->page, io_fix);
465
466
}
466
467
 
 
468
/*********************************************************************//**
 
469
Makes a block sticky. A sticky block implies that even after we release
 
470
the buf_pool->mutex and the block->mutex:
 
471
* it cannot be removed from the flush_list
 
472
* the block descriptor cannot be relocated
 
473
* it cannot be removed from the LRU list
 
474
Note that:
 
475
* the block can still change its position in the LRU list
 
476
* the next and previous pointers can change. */
 
477
UNIV_INLINE
 
478
void
 
479
buf_page_set_sticky(
 
480
/*================*/
 
481
        buf_page_t*     bpage)  /*!< in/out: control block */
 
482
{
 
483
#ifdef UNIV_DEBUG
 
484
        buf_pool_t*     buf_pool = buf_pool_from_bpage(bpage);
 
485
        ut_ad(buf_pool_mutex_own(buf_pool));
 
486
#endif
 
487
        ut_ad(mutex_own(buf_page_get_mutex(bpage)));
 
488
        ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_NONE);
 
489
 
 
490
        bpage->io_fix = BUF_IO_PIN;
 
491
}
 
492
 
 
493
/*********************************************************************//**
 
494
Removes stickiness of a block. */
 
495
UNIV_INLINE
 
496
void
 
497
buf_page_unset_sticky(
 
498
/*==================*/
 
499
        buf_page_t*     bpage)  /*!< in/out: control block */
 
500
{
 
501
#ifdef UNIV_DEBUG
 
502
        buf_pool_t*     buf_pool = buf_pool_from_bpage(bpage);
 
503
        ut_ad(buf_pool_mutex_own(buf_pool));
 
504
#endif
 
505
        ut_ad(mutex_own(buf_page_get_mutex(bpage)));
 
506
        ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_PIN);
 
507
 
 
508
        bpage->io_fix = BUF_IO_NONE;
 
509
}
 
510
 
467
511
/********************************************************************//**
468
512
Determine if a buffer block can be relocated in memory.  The block
469
513
can be dirty, but it must not be I/O-fixed or bufferfixed. */