~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/buf0lru.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
30
30
#include "ut0byte.h"
31
31
#include "buf0types.h"
32
32
 
33
 
/** The return type of buf_LRU_free_block() */
34
 
enum buf_lru_free_block_status {
35
 
        /** freed */
36
 
        BUF_LRU_FREED = 0,
37
 
        /** not freed because the caller asked to remove the
38
 
        uncompressed frame but the control block cannot be
39
 
        relocated */
40
 
        BUF_LRU_CANNOT_RELOCATE,
41
 
        /** not freed because of some other reason */
42
 
        BUF_LRU_NOT_FREED
43
 
};
44
 
 
45
33
/******************************************************************//**
46
34
Tries to remove LRU flushed blocks from the end of the LRU list and put them
47
35
to the free list. This is beneficial for the efficiency of the insert buffer
84
72
buf_LRU_invalidate_tablespace(
85
73
/*==========================*/
86
74
        ulint   id);    /*!< in: space id */
 
75
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
87
76
/********************************************************************//**
88
77
Insert a compressed block into buf_pool->zip_clean in the LRU order. */
89
78
UNIV_INTERN
91
80
buf_LRU_insert_zip_clean(
92
81
/*=====================*/
93
82
        buf_page_t*     bpage); /*!< in: pointer to the block in question */
 
83
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
94
84
 
95
85
/******************************************************************//**
96
86
Try to free a block.  If bpage is a descriptor of a compressed-only
97
87
page, the descriptor object will be freed as well.
98
88
 
99
 
NOTE: If this function returns BUF_LRU_FREED, it will temporarily
 
89
NOTE: If this function returns TRUE, it will temporarily
100
90
release buf_pool_mutex.  Furthermore, the page frame will no longer be
101
91
accessible via bpage.
102
92
 
103
93
The caller must hold buf_pool_mutex and buf_page_get_mutex(bpage) and
104
94
release these two mutexes after the call.  No other
105
95
buf_page_get_mutex() may be held when calling this function.
106
 
@return BUF_LRU_FREED if freed, BUF_LRU_CANNOT_RELOCATE or
107
 
BUF_LRU_NOT_FREED otherwise. */
 
96
@return TRUE if freed, FALSE otherwise. */
108
97
UNIV_INTERN
109
 
enum buf_lru_free_block_status
 
98
ibool
110
99
buf_LRU_free_block(
111
100
/*===============*/
112
101
        buf_page_t*     bpage,  /*!< in: block to be freed */
113
 
        ibool           zip,    /*!< in: TRUE if should remove also the
 
102
        ibool           zip)    /*!< in: TRUE if should remove also the
114
103
                                compressed page of an uncompressed page */
115
 
        ibool*          buf_pool_mutex_released);
116
 
                                /*!< in: pointer to a variable that will
117
 
                                be assigned TRUE if buf_pool_mutex
118
 
                                was temporarily released, or NULL */
 
104
        __attribute__((nonnull));
119
105
/******************************************************************//**
120
106
Try to free a replaceable block.
121
107
@return TRUE if found and freed */
146
132
@return the free control block, in state BUF_BLOCK_READY_FOR_USE */
147
133
UNIV_INTERN
148
134
buf_block_t*
149
 
buf_LRU_get_free_block(
150
 
/*===================*/
151
 
        ulint   zip_size);      /*!< in: compressed page size in bytes,
152
 
                                or 0 if uncompressed tablespace */
 
135
buf_LRU_get_free_block(void)
 
136
/*========================*/
 
137
        __attribute__((warn_unused_result));
153
138
 
154
139
/******************************************************************//**
155
140
Puts a block back to the free list. */