XMMS2
Macros | Enumerations | Functions
Log

Logs every action so we can redo changes if something crashes. More...

Macros

#define LOG_SIZE   (2*1024*1024)
 

Enumerations

enum  log_type_t {
  LOG_ENTRY_ADD = 0xaddadd, LOG_ENTRY_DEL = 0xde1e7e, LOG_ENTRY_WRAP = 0x123123, LOG_ENTRY_INIT = 0x87654321,
  LOG_ENTRY_BEGIN = 0x1, LOG_ENTRY_END = 0x2, LOG_ENTRY_WRITING = 0x3, LOG_ENTRY_CHECKPOINT = 0x4
}
 

Functions

s4_log_data_t_log_create_data ()
 
void _log_free_data (s4_log_data_t *data)
 
void _log_checkpoint (s4_t *s4)
 Writes a checkpoint entry to the log, marking that the database has finished being written to disk. More...
 
int _log_write (oplist_t *list)
 Writes all the operations in an oplist to disk. More...
 
int _log_open (s4_t *s4)
 Opens a log file. More...
 
int _log_close (s4_t *s4)
 Closes the log file. More...
 
void _log_lock_file (s4_t *s4)
 Locks the log file. More...
 
void _log_unlock_file (s4_t *s4)
 Unlocks the log file. More...
 
void _log_lock_db (s4_t *s4)
 Locks the database file. More...
 
void _log_unlock_db (s4_t *s4)
 Unlocks the database file. More...
 
log_number_t _log_last_synced (s4_t *s4)
 
void _log_init (s4_t *s4, log_number_t last_checkpoint)
 

Detailed Description

Logs every action so we can redo changes if something crashes.

Macro Definition Documentation

#define LOG_SIZE   (2*1024*1024)

Enumeration Type Documentation

enum 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 

Function Documentation

void _log_checkpoint ( s4_t s4)

Writes a checkpoint entry to the log, marking that the database has finished being written to disk.

Parameters
s4The database to write the log entry to.
int _log_close ( s4_t s4)

Closes the log file.

Parameters
s4The database to close the logfile of.
Returns
0 on error, non-zero on success.

Referenced by s4_close().

s4_log_data_t* _log_create_data ( void  )
void _log_free_data ( s4_log_data_t data)
void _log_init ( s4_t s4,
log_number_t  last_checkpoint 
)
log_number_t _log_last_synced ( s4_t s4)
void _log_lock_db ( s4_t s4)

Locks the database file.

This is actually a lock set on the log file.

Parameters
s4The database to log.
void _log_lock_file ( s4_t s4)

Locks the log file.

It will redo everything new in the log.

Parameters
s4The database to lock the log of.

Referenced by s4_begin().

int _log_open ( s4_t s4)

Opens a log file.

Parameters
s4The 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
s4The database to unlock.
void _log_unlock_file ( s4_t s4)

Unlocks the log file.

Parameters
s4The database to unlock the log of.

Referenced by s4_commit().

int _log_write ( oplist_t list)

Writes all the operations in an oplist to disk.

Parameters
listThe oplist to write.
Returns
0 on error, non-zero on success.

Referenced by s4_commit().