1 /*
2  * include/linux/journal-head.h
3  *
4  * buffer_head fields for JBD
5  *
6  * 27 May 2001 ANdrew Morton <andrewm@uow.edu.au>
7  *	Created - pulled out of fs.h
8  */
9 
10 #ifndef JOURNAL_HEAD_H_INCLUDED
11 #define JOURNAL_HEAD_H_INCLUDED
12 
13 typedef unsigned int		tid_t;		/* Unique transaction ID */
14 typedef struct transaction_s	transaction_t;	/* Compound transaction type */
15 struct buffer_head;
16 
17 struct journal_head {
18 #ifndef CONFIG_JBD_UNIFIED_BUFFERS
19 	/* Points back to our buffer_head. */
20 	struct buffer_head *b_bh;
21 #endif
22 
23 	/* Reference count - see description in journal.c */
24 	int b_jcount;
25 
26 	/* Journaling list for this buffer */
27 	unsigned b_jlist;
28 
29 	/* Copy of the buffer data frozen for writing to the log. */
30 	char * b_frozen_data;
31 
32 	/* Pointer to a saved copy of the buffer containing no
33            uncommitted deallocation references, so that allocations can
34            avoid overwriting uncommitted deletes. */
35 	char * b_committed_data;
36 
37 	/* Pointer to the compound transaction which owns this buffer's
38            metadata: either the running transaction or the committing
39            transaction (if there is one).  Only applies to buffers on a
40            transaction's data or metadata journaling list. */
41 	/* Protected by journal_datalist_lock */
42 	transaction_t * b_transaction;
43 
44 	/* Pointer to the running compound transaction which is
45            currently modifying the buffer's metadata, if there was
46            already a transaction committing it when the new transaction
47            touched it. */
48 	transaction_t * b_next_transaction;
49 
50 	/* Doubly-linked list of buffers on a transaction's data,
51            metadata or forget queue. */
52 	/* Protected by journal_datalist_lock */
53 	struct journal_head *b_tnext, *b_tprev;
54 
55 	/*
56 	 * Pointer to the compound transaction against which this buffer
57 	 * is checkpointed.  Only dirty buffers can be checkpointed.
58 	 */
59 	/* Protected by journal_datalist_lock */
60 	transaction_t * b_cp_transaction;
61 
62 	/*
63 	 * Doubly-linked list of buffers still remaining to be flushed
64 	 * before an old transaction can be checkpointed.
65 	 */
66 	/* Protected by journal_datalist_lock */
67 	struct journal_head *b_cpnext, *b_cpprev;
68 };
69 
70 #endif		/* JOURNAL_HEAD_H_INCLUDED */
71