MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / PAG_set_force_write

Function PAG_set_force_write

src/jrd/pag.cpp:1687–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1685
1686
1687void PAG_set_force_write(thread_db* tdbb, bool flag)
1688{
1689/**************************************
1690 *
1691 * P A G _ s e t _ f o r c e _ w r i t e
1692 *
1693 **************************************
1694 *
1695 * Functional description
1696 * Turn on/off force write.
1697 *
1698 **************************************/
1699 SET_TDBB(tdbb);
1700 Database* dbb = tdbb->getDatabase();
1701
1702 err_post_if_database_is_readonly(dbb);
1703
1704 WIN window(HEADER_PAGE_NUMBER);
1705 header_page* header = (header_page*) CCH_FETCH(tdbb, &window, LCK_write, pag_header);
1706 CCH_MARK_MUST_WRITE(tdbb, &window);
1707
1708 if (flag)
1709 {
1710 header->hdr_flags |= hdr_force_write;
1711 dbb->dbb_flags |= DBB_force_write;
1712 }
1713 else
1714 {
1715 header->hdr_flags &= ~hdr_force_write;
1716 dbb->dbb_flags &= ~DBB_force_write;
1717 }
1718
1719 CCH_RELEASE(tdbb, &window);
1720
1721 PageSpace* pageSpace = dbb->dbb_page_manager.findPageSpace(DB_PAGE_SPACE);
1722 for (jrd_file* file = pageSpace->file; file; file = file->fil_next) {
1723 PIO_force_write(file, flag, dbb->dbb_flags & DBB_no_fs_cache);
1724 }
1725
1726 for (Shadow* shadow = dbb->dbb_shadow; shadow; shadow = shadow->sdw_next)
1727 {
1728 for (jrd_file* file = shadow->sdw_file; file; file = file->fil_next) {
1729 PIO_force_write(file, flag, dbb->dbb_flags & DBB_no_fs_cache);
1730 }
1731 }
1732}
1733
1734
1735void PAG_set_no_reserve(thread_db* tdbb, bool flag)

Callers 2

internalAttachMethod · 0.85
createDatabaseMethod · 0.85

Calls 8

SET_TDBBFunction · 0.85
CCH_FETCHFunction · 0.85
CCH_MARK_MUST_WRITEFunction · 0.85
CCH_RELEASEFunction · 0.85
getDatabaseMethod · 0.80
findPageSpaceMethod · 0.80
PIO_force_writeFunction · 0.50

Tested by

no test coverage detected