-struct journal_s
-{
- /* General journaling state flags */
- unsigned long j_flags;
-
- /* Is there an outstanding uncleared error on the journal (from
- * a prior abort)? */
- int j_errno;
-
- /* The superblock buffer */
- struct buffer_head * j_sb_buffer;
- journal_superblock_t * j_superblock;
-
- /* Version of the superblock format */
- int j_format_version;
-
- /* Number of processes waiting to create a barrier lock */
- int j_barrier_count;
-
- /* The barrier lock itself */
- struct semaphore j_barrier;
-
- /* Transactions: The current running transaction... */
- transaction_t * j_running_transaction;
-
- /* ... the transaction we are pushing to disk ... */
- transaction_t * j_committing_transaction;
-
- /* ... and a linked circular list of all transactions waiting
- * for checkpointing. */
- /* Protected by journal_datalist_lock */
- transaction_t * j_checkpoint_transactions;
-
- /* Wait queue for waiting for a locked transaction to start
- committing, or for a barrier lock to be released */
- wait_queue_head_t j_wait_transaction_locked;
-
- /* Wait queue for waiting for checkpointing to complete */
- wait_queue_head_t j_wait_logspace;
-
- /* Wait queue for waiting for commit to complete */
- wait_queue_head_t j_wait_done_commit;
-
- /* Wait queue to trigger checkpointing */
- wait_queue_head_t j_wait_checkpoint;
-
- /* Wait queue to trigger commit */
- wait_queue_head_t j_wait_commit;
-
- /* Wait queue to wait for updates to complete */
- wait_queue_head_t j_wait_updates;
-
- /* Semaphore for locking against concurrent checkpoints */
- struct semaphore j_checkpoint_sem;
-
- /* The main journal lock, used by lock_journal() */
- struct semaphore j_sem;
-
- /* Journal head: identifies the first unused block in the journal. */
- unsigned long j_head;
-
- /* Journal tail: identifies the oldest still-used block in the
- * journal. */
- unsigned long j_tail;
-
- /* Journal free: how many free blocks are there in the journal? */
- unsigned long j_free;
-
- /* Journal start and end: the block numbers of the first usable
- * block and one beyond the last usable block in the journal. */
- unsigned long j_first, j_last;
-
- /* Device, blocksize and starting block offset for the location
- * where we store the journal. */
- kdev_t j_dev;
- int j_blocksize;
- unsigned int j_blk_offset;
-
- /* Device which holds the client fs. For internal journal this
- * will be equal to j_dev. */
- kdev_t j_fs_dev;
-
- /* Total maximum capacity of the journal region on disk. */
- unsigned int j_maxlen;
-
- /* Optional inode where we store the journal. If present, all
- * journal block numbers are mapped into this inode via
- * bmap(). */
- struct inode * j_inode;
-
- /* Sequence number of the oldest transaction in the log */
- tid_t j_tail_sequence;
- /* Sequence number of the next transaction to grant */
- tid_t j_transaction_sequence;
- /* Sequence number of the most recently committed transaction */
- tid_t j_commit_sequence;
- /* Sequence number of the most recent transaction wanting commit */
- tid_t j_commit_request;
-
- /* Journal uuid: identifies the object (filesystem, LVM volume
- * etc) backed by this journal. This will eventually be
- * replaced by an array of uuids, allowing us to index multiple
- * devices within a single journal and to perform atomic updates
- * across them. */
-
- __u8 j_uuid[16];
-
- /* Pointer to the current commit thread for this journal */
- struct task_struct * j_task;
-
- /* Maximum number of metadata buffers to allow in a single
- * compound commit transaction */
- int j_max_transaction_buffers;
-
- /* What is the maximum transaction lifetime before we begin a
- * commit? */
- unsigned long j_commit_interval;
-
- /* The timer used to wakeup the commit thread: */
- struct timer_list * j_commit_timer;
- int j_commit_timer_active;
-
- /* Link all journals together - system-wide */
- struct list_head j_all_journals;
-
- /* The revoke table: maintains the list of revoked blocks in the
- current transaction. */
- struct jbd_revoke_table_s *j_revoke;
-};
-
-/*
- * Journal flag definitions
- */
-#define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */
-#define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */
-#define JFS_ACK_ERR 0x004 /* The errno in the sb has been acked */
-#define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */
-#define JFS_LOADED 0x010 /* The journal superblock has been loaded */
-
-/*
- * Function declarations for the journaling transaction and buffer
- * management
- */
-
-/* Filing buffers */
-extern void __journal_unfile_buffer(struct journal_head *);
-extern void journal_unfile_buffer(struct journal_head *);
-extern void __journal_refile_buffer(struct journal_head *);
-extern void journal_refile_buffer(struct journal_head *);
-extern void __journal_file_buffer(struct journal_head *, transaction_t *, int);
-extern void __journal_free_buffer(struct journal_head *bh);
-extern void journal_file_buffer(struct journal_head *, transaction_t *, int);
-extern void __journal_clean_data_list(transaction_t *transaction);
-
-/* Log buffer allocation */
-extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
-extern unsigned long journal_next_log_block(journal_t *);
-
-/* Commit management */
-extern void journal_commit_transaction(journal_t *);
-
-/* Checkpoint list management */
-int __journal_clean_checkpoint_list(journal_t *journal);
-extern void journal_remove_checkpoint(struct journal_head *);
-extern void __journal_remove_checkpoint(struct journal_head *);
-extern void journal_insert_checkpoint(struct journal_head *, transaction_t *);
-extern void __journal_insert_checkpoint(struct journal_head *,transaction_t *);
-
-/* Buffer IO */
-extern int
-journal_write_metadata_buffer(transaction_t *transaction,
- struct journal_head *jh_in,
- struct journal_head **jh_out,
- int blocknr);
-
-/* Transaction locking */
-extern void __wait_on_journal (journal_t *);