diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-03-21 18:03:09 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-03-21 18:03:09 +0200 |
commit | a251389029abac07b2ddaf0f8f36243a493ee9a8 (patch) | |
tree | 8484c3bb65d40af0743b44a24a788dc2d5cf7d48 /innobase/trx | |
parent | fbcea143c7c6ed19653b728f61413d3b648e1613 (diff) | |
download | mariadb-git-a251389029abac07b2ddaf0f8f36243a493ee9a8.tar.gz |
Many files:
Merge InnoDB-3.23.50
innobase/btr/btr0btr.c:
Merge InnoDB-3.23.50
innobase/btr/btr0cur.c:
Merge InnoDB-3.23.50
innobase/btr/btr0sea.c:
Merge InnoDB-3.23.50
innobase/buf/buf0buf.c:
Merge InnoDB-3.23.50
innobase/buf/buf0flu.c:
Merge InnoDB-3.23.50
innobase/dict/dict0dict.c:
Merge InnoDB-3.23.50
innobase/dict/dict0load.c:
Merge InnoDB-3.23.50
innobase/fil/fil0fil.c:
Merge InnoDB-3.23.50
innobase/fsp/fsp0fsp.c:
Merge InnoDB-3.23.50
innobase/include/buf0flu.h:
Merge InnoDB-3.23.50
innobase/include/dict0dict.h:
Merge InnoDB-3.23.50
innobase/include/fil0fil.h:
Merge InnoDB-3.23.50
innobase/include/fsp0fsp.h:
Merge InnoDB-3.23.50
innobase/include/log0log.h:
Merge InnoDB-3.23.50
innobase/include/log0recv.h:
Merge InnoDB-3.23.50
innobase/include/mem0mem.h:
Merge InnoDB-3.23.50
innobase/include/os0file.h:
Merge InnoDB-3.23.50
innobase/include/row0mysql.h:
Merge InnoDB-3.23.50
innobase/include/srv0srv.h:
Merge InnoDB-3.23.50
innobase/include/srv0start.h:
Merge InnoDB-3.23.50
innobase/include/trx0sys.h:
Merge InnoDB-3.23.50
innobase/include/ut0byte.h:
Merge InnoDB-3.23.50
innobase/include/ut0rnd.h:
Merge InnoDB-3.23.50
innobase/include/ut0ut.h:
Merge InnoDB-3.23.50
innobase/log/log0log.c:
Merge InnoDB-3.23.50
innobase/log/log0recv.c:
Merge InnoDB-3.23.50
innobase/mem/mem0mem.c:
Merge InnoDB-3.23.50
innobase/os/os0file.c:
Merge InnoDB-3.23.50
innobase/rem/rem0cmp.c:
Merge InnoDB-3.23.50
innobase/row/row0ins.c:
Merge InnoDB-3.23.50
innobase/row/row0mysql.c:
Merge InnoDB-3.23.50
innobase/row/row0sel.c:
Merge InnoDB-3.23.50
innobase/row/row0upd.c:
Merge InnoDB-3.23.50
innobase/srv/srv0srv.c:
Merge InnoDB-3.23.50
innobase/srv/srv0start.c:
Merge InnoDB-3.23.50
innobase/trx/trx0sys.c:
Merge InnoDB-3.23.50
innobase/ut/ut0mem.c:
Merge InnoDB-3.23.50
innobase/ut/ut0ut.c:
Merge InnoDB-3.23.50
sql/ha_innobase.cc:
Merge InnoDB-3.23.50
sql/ha_innobase.h:
Merge InnoDB-3.23.50
Diffstat (limited to 'innobase/trx')
-rw-r--r-- | innobase/trx/trx0sys.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index b29ffb4b3bf..6c9776560bd 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -20,12 +20,43 @@ Created 3/26/1996 Heikki Tuuri #include "srv0srv.h" #include "trx0purge.h" #include "log0log.h" +#include "os0file.h" /* The transaction system */ trx_sys_t* trx_sys = NULL; trx_doublewrite_t* trx_doublewrite = NULL; /******************************************************************** +Determines if a page number is located inside the doublewrite buffer. */ + +ibool +trx_doublewrite_page_inside( +/*========================*/ + /* out: TRUE if the location is inside + the two blocks of the doublewrite buffer */ + ulint page_no) /* in: page number */ +{ + if (trx_doublewrite == NULL) { + + return(FALSE); + } + + if (page_no >= trx_doublewrite->block1 + && page_no < trx_doublewrite->block1 + + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { + return(TRUE); + } + + if (page_no >= trx_doublewrite->block2 + && page_no < trx_doublewrite->block2 + + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { + return(TRUE); + } + + return(FALSE); +} + +/******************************************************************** Creates or initialializes the doublewrite buffer at a database start. */ static void @@ -36,6 +67,11 @@ trx_doublewrite_init( { trx_doublewrite = mem_alloc(sizeof(trx_doublewrite_t)); + /* When we have the doublewrite buffer in use, we do not need to + call os_file_flush (Unix fsync) after every write. */ + + os_do_not_call_flush_at_each_write = TRUE; + mutex_create(&(trx_doublewrite->mutex)); mutex_set_level(&(trx_doublewrite->mutex), SYNC_DOUBLEWRITE); |