Logs every action so we can redo changes if something crashes.
More...
Logs every action so we can redo changes if something crashes.
#define LOG_SIZE (2*1024*1024) |
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 |
|
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. |
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().
void _log_lock_db |
( |
s4_t * |
s4 | ) |
|
Locks the database file.
This is actually a lock set on the log file.
- Parameters
-
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().
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().
void _log_unlock_db |
( |
s4_t * |
s4 | ) |
|
Unlocks the database file.
- Parameters
-
s4 | The database to unlock. |
void _log_unlock_file |
( |
s4_t * |
s4 | ) |
|
Unlocks the log file.
- Parameters
-
s4 | The database to unlock the log of. |
Referenced by s4_commit().
Writes all the operations in an oplist to disk.
- Parameters
-
- Returns
- 0 on error, non-zero on success.
Referenced by s4_commit().