Lines Matching refs:journal

77 struct journal;
95 off_t journal_start; // where in the journal this transaction starts
96 off_t journal_end; // where in the journal this transaction ends
97 struct journal *jnl; // ptr back to the journal structure
107 * This is written to block zero of the journal and it
108 * maintains overall state about the journal.
115 off_t size; // size in bytes of the entire journal
116 int32_t blhdr_size; // size in bytes of each block_list_header in the journal
118 int32_t jhdr_size; // block size (in bytes) of the journal header
137 * In memory structure about the journal.
139 typedef struct journal {
140 lck_mtx_t jlock; // protects the struct journal data
141 lck_mtx_t flock; // serializes flushing of journal
145 struct vnode *jdev; // vnode of the device where the journal lives
146 off_t jdev_offset; // byte offset to the start of the journal
167 char *header_buf; // in-memory copy of the journal header
190 } journal;
192 /* internal-only journal flags (top 16 bits) */
215 * Call journal_create() to create a new journal. You only
218 * The "jvp" argument is the vnode where the journal is written.
219 * The journal starts at "offset" and is "journal_size" bytes long.
234 * used by the journal. If you specify zero, the journal code
238 * Returns a valid journal pointer or NULL if one could not
241 journal *journal_create(struct vnode *jvp,
254 * that has a previously created journal. It will take care
255 * of validating the journal and replaying it if necessary.
259 * Returns a valid journal pointer of NULL if it runs into
260 * trouble reading/playing back the journal.
262 journal *journal_open(struct vnode *jvp,
274 * Test whether the journal is clean or not. This is intended
275 * to be used when you're mounting read-only. If the journal
289 * journal is in a consistent state.
291 void journal_close(journal *journalp);
317 * that the journal does not play it back (effectively
323 * will be trimmed when the transaction is flushed to the on-disk journal.
325 int journal_start_transaction(journal *jnl);
326 int journal_modify_block_start(journal *jnl, struct buf *bp);
327 int journal_modify_block_abort(journal *jnl, struct buf *bp);
328 int journal_modify_block_end(journal *jnl, struct buf *bp, void (*func)(struct buf *bp, void *arg), void *arg);
329 int journal_kill_block(journal *jnl, struct buf *bp);
331 int journal_trim_add_extent(journal *jnl, uint64_t offset, uint64_t length);
332 int journal_trim_remove_extent(journal *jnl, uint64_t offset, uint64_t length);
333 void journal_trim_set_callback(journal *jnl, jnl_trim_callback_t callback, void *arg);
334 int journal_trim_extent_overlap (journal *jnl, uint64_t offset, uint64_t length, uint64_t *end);
335 /* Mark state in the journal that requests an immediate journal flush upon txn completion */
336 int journal_request_immediate_flush (journal *jnl);
338 int journal_end_transaction(journal *jnl);
340 int journal_active(journal *jnl);
341 int journal_flush(journal *jnl, boolean_t wait_for_IO);
342 void *journal_owner(journal *jnl); // compare against current_thread()
343 int journal_uses_fua(journal *jnl);
344 void journal_lock(journal *jnl);
345 void journal_unlock(journal *jnl);
349 * Relocate the journal.
351 * You provide the new starting offset and size for the journal. You may
353 * changing the tbuffer size except as needed to fit within the new journal
357 * modified blocks (such as those needed to deallocate the old journal,
358 * allocate the new journal, and update the location and size of the journal
360 * transaction will be flushed to the old journal. The new journal will be
362 * the new journal. The caller will need to update the structures that
363 * identify the location and size of the journal from the callback routine.
365 int journal_relocate(journal *jnl, off_t offset, off_t journal_size, int32_t tbuffer_size,