~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/buf0flu.ic

  • Committer: Brian Aker
  • Date: 2010-10-28 17:12:01 UTC
  • mfrom: (1887.1.3 merge)
  • Revision ID: brian@tangent.org-20101028171201-baj6l1bnntn1s4ad
Merge in POTFILES changes.

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, 2009, Innobase Oy. 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
34
34
void
35
35
buf_flush_insert_into_flush_list(
36
36
/*=============================*/
37
 
        buf_pool_t*     buf_pool,       /*!< buffer pool instance */
38
 
        buf_block_t*    block,          /*!< in/out: block which is modified */
39
 
        ib_uint64_t     lsn);           /*!< in: oldest modification */
 
37
        buf_block_t*    block); /*!< in/out: block which is modified */
40
38
/********************************************************************//**
41
39
Inserts a modified block into the flush list in the right sorted position.
42
40
This function is used by recovery, because there the modifications do not
45
43
void
46
44
buf_flush_insert_sorted_into_flush_list(
47
45
/*====================================*/
48
 
        buf_pool_t*     buf_pool,       /*!< buffer pool instance */
49
 
        buf_block_t*    block,          /*!< in/out: block which is modified */
50
 
        ib_uint64_t     lsn);           /*!< in: oldest modification */
 
46
        buf_block_t*    block); /*!< in/out: block which is modified */
51
47
 
52
48
/********************************************************************//**
53
49
This function should be called at a mini-transaction commit, if a page was
60
56
        buf_block_t*    block,  /*!< in: block which is modified */
61
57
        mtr_t*          mtr)    /*!< in: mtr */
62
58
{
63
 
        buf_pool_t*     buf_pool = buf_pool_from_block(block);
64
 
 
65
59
        ut_ad(block);
66
60
        ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
67
61
        ut_ad(block->page.buf_fix_count > 0);
68
62
#ifdef UNIV_SYNC_DEBUG
69
63
        ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
70
64
#endif /* UNIV_SYNC_DEBUG */
71
 
 
72
 
        ut_ad(!buf_pool_mutex_own(buf_pool));
73
 
        ut_ad(!buf_flush_list_mutex_own(buf_pool));
74
 
        ut_ad(log_flush_order_mutex_own());
 
65
        ut_ad(buf_pool_mutex_own());
75
66
 
76
67
        ut_ad(mtr->start_lsn != 0);
77
68
        ut_ad(mtr->modifications);
78
 
 
79
 
        mutex_enter(&block->mutex);
80
69
        ut_ad(block->page.newest_modification <= mtr->end_lsn);
81
70
 
82
71
        block->page.newest_modification = mtr->end_lsn;
83
72
 
84
73
        if (!block->page.oldest_modification) {
85
 
                buf_flush_insert_into_flush_list(
86
 
                        buf_pool, block, mtr->start_lsn);
 
74
 
 
75
                block->page.oldest_modification = mtr->start_lsn;
 
76
                ut_ad(block->page.oldest_modification != 0);
 
77
 
 
78
                buf_flush_insert_into_flush_list(block);
87
79
        } else {
88
80
                ut_ad(block->page.oldest_modification <= mtr->start_lsn);
89
81
        }
90
82
 
91
 
        mutex_exit(&block->mutex);
92
 
 
93
83
        ++srv_buf_pool_write_requests;
94
84
}
95
85
 
105
95
        ib_uint64_t     end_lsn)        /*!< in: end lsn of the last mtr in the
106
96
                                        set of mtr's */
107
97
{
108
 
        buf_pool_t*     buf_pool = buf_pool_from_block(block);
109
 
 
110
98
        ut_ad(block);
111
99
        ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
112
100
        ut_ad(block->page.buf_fix_count > 0);
114
102
        ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
115
103
#endif /* UNIV_SYNC_DEBUG */
116
104
 
117
 
        ut_ad(!buf_pool_mutex_own(buf_pool));
118
 
        ut_ad(!buf_flush_list_mutex_own(buf_pool));
119
 
        ut_ad(log_flush_order_mutex_own());
 
105
        buf_pool_mutex_enter();
120
106
 
121
 
        ut_ad(start_lsn != 0);
122
107
        ut_ad(block->page.newest_modification <= end_lsn);
123
108
 
124
 
        mutex_enter(&block->mutex);
125
109
        block->page.newest_modification = end_lsn;
126
110
 
127
111
        if (!block->page.oldest_modification) {
128
 
                buf_flush_insert_sorted_into_flush_list(
129
 
                        buf_pool, block, start_lsn);
 
112
 
 
113
                block->page.oldest_modification = start_lsn;
 
114
 
 
115
                ut_ad(block->page.oldest_modification != 0);
 
116
 
 
117
                buf_flush_insert_sorted_into_flush_list(block);
130
118
        } else {
131
119
                ut_ad(block->page.oldest_modification <= start_lsn);
132
120
        }
133
121
 
134
 
        mutex_exit(&block->mutex);
135
 
 
 
122
        buf_pool_mutex_exit();
136
123
}
137
124
#endif /* !UNIV_HOTBACKUP */