~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-12-17 00:08:06 UTC
  • mfrom: (2002.1.4 clean)
  • Revision ID: brian@tangent.org-20101217000806-fa6kmggjnhsl4q85
Rollup for field encapsulation, monty fix for bzrignore, and Andrew bug
fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1995, 2010, Innobase Oy. All Rights Reserved.
4
 
Copyright (C) 2008, Google Inc.
 
3
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
 
4
Copyright (c) 2008, Google Inc.
5
5
 
6
6
Portions of this file contain modifications contributed and copyrighted by
7
7
Google, Inc. Those modifications are gratefully acknowledged and are described
47
47
        return(srv_buf_pool_curr_size);
48
48
}
49
49
 
50
 
/********************************************************************//**
51
 
Calculates the index of a buffer pool to the buf_pool[] array.
52
 
@return the position of the buffer pool in buf_pool[] */
53
 
UNIV_INLINE
54
 
ulint
55
 
buf_pool_index(
56
 
/*===========*/
57
 
        const buf_pool_t*       buf_pool)       /*!< in: buffer pool */
58
 
{
59
 
        ulint   i = buf_pool - buf_pool_ptr;
60
 
        ut_ad(i < MAX_BUFFER_POOLS);
61
 
        ut_ad(i < srv_buf_pool_instances);
62
 
        return(i);
63
 
}
64
 
 
65
 
/******************************************************************//**
66
 
Returns the buffer pool instance given a page instance
67
 
@return buf_pool */
68
 
UNIV_INLINE
69
 
buf_pool_t*
70
 
buf_pool_from_bpage(
71
 
/*================*/
72
 
        const buf_page_t*       bpage) /*!< in: buffer pool page */
73
 
{
74
 
        ulint   i;
75
 
        i = bpage->buf_pool_index;
76
 
        ut_ad(i < srv_buf_pool_instances);
77
 
        return(&buf_pool_ptr[i]);
78
 
}
79
 
 
80
 
/******************************************************************//**
81
 
Returns the buffer pool instance given a block instance
82
 
@return buf_pool */
83
 
UNIV_INLINE
84
 
buf_pool_t*
85
 
buf_pool_from_block(
86
 
/*================*/
87
 
        const buf_block_t*      block) /*!< in: block */
88
 
{
89
 
        return(buf_pool_from_bpage(&block->page));
90
 
}
91
 
 
92
50
/*********************************************************************//**
93
51
Gets the current size of buffer buf_pool in pages.
94
52
@return size in pages*/
929
887
}
930
888
 
931
889
/******************************************************************//**
 
890
Returns the buffer pool instance given a page instance
 
891
@return buf_pool */
 
892
UNIV_INLINE
 
893
buf_pool_t*
 
894
buf_pool_from_bpage(
 
895
/*================*/
 
896
        const buf_page_t*       bpage) /*!< in: buffer pool page */
 
897
{
 
898
        /* Every page must be in some buffer pool. */
 
899
        ut_ad(bpage->buf_pool != NULL);
 
900
 
 
901
        return(bpage->buf_pool);
 
902
}
 
903
 
 
904
/******************************************************************//**
 
905
Returns the buffer pool instance given a block instance
 
906
@return buf_pool */
 
907
UNIV_INLINE
 
908
buf_pool_t*
 
909
buf_pool_from_block(
 
910
/*================*/
 
911
        const buf_block_t*      block) /*!< in: block */
 
912
{
 
913
        return(buf_pool_from_bpage(&block->page));
 
914
}
 
915
 
 
916
/******************************************************************//**
932
917
Returns the buffer pool instance given space and offset of page
933
918
@return buffer pool */
934
919
UNIV_INLINE
945
930
        ignored_offset = offset >> 6; /* 2log of BUF_READ_AHEAD_AREA (64)*/
946
931
        fold = buf_page_address_fold(space, ignored_offset);
947
932
        index = fold % srv_buf_pool_instances;
948
 
        return(&buf_pool_ptr[index]);
 
933
        return buf_pool_ptr[index];
949
934
}
950
935
 
951
936
/******************************************************************//**
955
940
buf_pool_t*
956
941
buf_pool_from_array(
957
942
/*================*/
958
 
        ulint   index)          /*!< in: array index to get
 
943
        ulint   index)          /*!< in: array index to get
959
944
                                buffer pool instance from */
960
945
{
961
 
        ut_ad(index < MAX_BUFFER_POOLS);
962
 
        ut_ad(index < srv_buf_pool_instances);
963
 
        return(&buf_pool_ptr[index]);
 
946
        return buf_pool_ptr[index];
964
947
}
965
948
 
966
949
/******************************************************************//**