Implement write and redo functions for journaling