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

« back to all changes in this revision

Viewing changes to storage/innobase/fil/fil0fil.c

  • 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:
1803
1803
}
1804
1804
 
1805
1805
/*******************************************************************//**
1806
 
Reads the flushed lsn and arch no fields from a data file at database
1807
 
startup. */
 
1806
Reads the flushed lsn, arch no, and tablespace flag fields from a data
 
1807
file at database startup. */
1808
1808
UNIV_INTERN
1809
1809
void
1810
 
fil_read_flushed_lsn_and_arch_log_no(
1811
 
/*=================================*/
 
1810
fil_read_first_page(
 
1811
/*================*/
1812
1812
        os_file_t       data_file,              /*!< in: open data file */
1813
1813
        ibool           one_read_already,       /*!< in: TRUE if min and max
1814
1814
                                                parameters below already
1815
1815
                                                contain sensible data */
 
1816
        ulint*          flags,                  /*!< out: tablespace flags */
1816
1817
#ifdef UNIV_LOG_ARCHIVE
1817
 
        ulint*          min_arch_log_no,        /*!< in/out: */
1818
 
        ulint*          max_arch_log_no,        /*!< in/out: */
 
1818
        ulint*          min_arch_log_no,        /*!< out: min of archived
 
1819
                                                log numbers in data files */
 
1820
        ulint*          max_arch_log_no,        /*!< out: max of archived
 
1821
                                                log numbers in data files */
1819
1822
#endif /* UNIV_LOG_ARCHIVE */
1820
 
        ib_uint64_t*    min_flushed_lsn,        /*!< in/out: */
1821
 
        ib_uint64_t*    max_flushed_lsn)        /*!< in/out: */
 
1823
        ib_uint64_t*    min_flushed_lsn,        /*!< out: min of flushed
 
1824
                                                lsn values in data files */
 
1825
        ib_uint64_t*    max_flushed_lsn)        /*!< out: max of flushed
 
1826
                                                lsn values in data files */
1822
1827
{
1823
1828
        byte*           buf;
1824
 
        byte*           buf2;
 
1829
        page_t*         page;
1825
1830
        ib_uint64_t     flushed_lsn;
1826
1831
 
1827
 
        buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
 
1832
        buf = ut_malloc(2 * UNIV_PAGE_SIZE);
1828
1833
        /* Align the memory for a possible read from a raw device */
1829
 
        buf = ut_align(buf2, UNIV_PAGE_SIZE);
1830
 
 
1831
 
        os_file_read(data_file, buf, 0, 0, UNIV_PAGE_SIZE);
1832
 
 
1833
 
        flushed_lsn = mach_read_from_8(buf + FIL_PAGE_FILE_FLUSH_LSN);
1834
 
 
1835
 
        ut_free(buf2);
 
1834
        page = ut_align(buf, UNIV_PAGE_SIZE);
 
1835
 
 
1836
        os_file_read(data_file, page, 0, 0, UNIV_PAGE_SIZE);
 
1837
 
 
1838
        *flags = mach_read_from_4(page +
 
1839
                FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
 
1840
 
 
1841
        flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN);
 
1842
 
 
1843
        ut_free(buf);
1836
1844
 
1837
1845
        if (!one_read_already) {
1838
1846
                *min_flushed_lsn = flushed_lsn;