Logs every action so we can redo changes if something crashes.
More...
Logs every action so we can redo changes if something crashes.
◆ LOG_SIZE
#define LOG_SIZE (2*1024*1024) |
◆ log_type_t
Enumerator |
---|
LOG_ENTRY_ADD | |
LOG_ENTRY_DEL | |
LOG_ENTRY_WRAP | |
LOG_ENTRY_INIT | |
LOG_ENTRY_BEGIN | |
LOG_ENTRY_END | |
LOG_ENTRY_WRITING | |
LOG_ENTRY_CHECKPOINT | |
◆ _log_checkpoint()
void _log_checkpoint |
( |
s4_t * | s4 | ) |
|
Writes a checkpoint entry to the log, marking that the database has finished being written to disk.
- Parameters
-
s4 | The database to write the log entry to. |
◆ _log_close()
int _log_close |
( |
s4_t * | s4 | ) |
|
Closes the log file.
- Parameters
-
s4 | The database to close the logfile of. |
- Returns
- 0 on error, non-zero on success.
Referenced by s4_close().
◆ _log_create_data()
◆ _log_free_data()
◆ _log_init()
◆ _log_last_synced()
◆ _log_lock_db()
void _log_lock_db |
( |
s4_t * | s4 | ) |
|
Locks the database file.
This is actually a lock set on the log file.
- Parameters
-
◆ _log_lock_file()
void _log_lock_file |
( |
s4_t * | s4 | ) |
|
Locks the log file.
It will redo everything new in the log.
- Parameters
-
s4 | The database to lock the log of. |
Referenced by s4_begin().
◆ _log_open()
int _log_open |
( |
s4_t * | s4 | ) |
|
Opens a log file.
- Parameters
-
s4 | The database to open the logfile for |
- Returns
- 0 on error, non-zero otherwise
Referenced by s4_open().
◆ _log_unlock_db()
void _log_unlock_db |
( |
s4_t * | s4 | ) |
|
Unlocks the database file.
- Parameters
-
s4 | The database to unlock. |
◆ _log_unlock_file()
void _log_unlock_file |
( |
s4_t * | s4 | ) |
|
Unlocks the log file.
- Parameters
-
s4 | The database to unlock the log of. |
Referenced by s4_commit().
◆ _log_write()
Writes all the operations in an oplist to disk.
- Parameters
-
- Returns
- 0 on error, non-zero on success.
Referenced by s4_commit().