| .. | .. |
|---|
| 11 | 11 | #ifndef JOURNAL_HEAD_H_INCLUDED |
|---|
| 12 | 12 | #define JOURNAL_HEAD_H_INCLUDED |
|---|
| 13 | 13 | |
|---|
| 14 | +#include <linux/spinlock.h> |
|---|
| 15 | + |
|---|
| 14 | 16 | typedef unsigned int tid_t; /* Unique transaction ID */ |
|---|
| 15 | 17 | typedef struct transaction_s transaction_t; /* Compound transaction type */ |
|---|
| 16 | 18 | |
|---|
| .. | .. |
|---|
| 24 | 26 | struct buffer_head *b_bh; |
|---|
| 25 | 27 | |
|---|
| 26 | 28 | /* |
|---|
| 29 | + * Protect the buffer head state |
|---|
| 30 | + */ |
|---|
| 31 | + spinlock_t b_state_lock; |
|---|
| 32 | + |
|---|
| 33 | + /* |
|---|
| 27 | 34 | * Reference count - see description in journal.c |
|---|
| 28 | 35 | * [jbd_lock_bh_journal_head()] |
|---|
| 29 | 36 | */ |
|---|
| 30 | 37 | int b_jcount; |
|---|
| 31 | 38 | |
|---|
| 32 | 39 | /* |
|---|
| 33 | | - * Journalling list for this buffer [jbd_lock_bh_state()] |
|---|
| 40 | + * Journalling list for this buffer [b_state_lock] |
|---|
| 34 | 41 | * NOTE: We *cannot* combine this with b_modified into a bitfield |
|---|
| 35 | 42 | * as gcc would then (which the C standard allows but which is |
|---|
| 36 | 43 | * very unuseful) make 64-bit accesses to the bitfield and clobber |
|---|
| .. | .. |
|---|
| 41 | 48 | /* |
|---|
| 42 | 49 | * This flag signals the buffer has been modified by |
|---|
| 43 | 50 | * the currently running transaction |
|---|
| 44 | | - * [jbd_lock_bh_state()] |
|---|
| 51 | + * [b_state_lock] |
|---|
| 45 | 52 | */ |
|---|
| 46 | 53 | unsigned b_modified; |
|---|
| 47 | 54 | |
|---|
| 48 | 55 | /* |
|---|
| 49 | 56 | * Copy of the buffer data frozen for writing to the log. |
|---|
| 50 | | - * [jbd_lock_bh_state()] |
|---|
| 57 | + * [b_state_lock] |
|---|
| 51 | 58 | */ |
|---|
| 52 | 59 | char *b_frozen_data; |
|---|
| 53 | 60 | |
|---|
| 54 | 61 | /* |
|---|
| 55 | 62 | * Pointer to a saved copy of the buffer containing no uncommitted |
|---|
| 56 | 63 | * deallocation references, so that allocations can avoid overwriting |
|---|
| 57 | | - * uncommitted deletes. [jbd_lock_bh_state()] |
|---|
| 64 | + * uncommitted deletes. [b_state_lock] |
|---|
| 58 | 65 | */ |
|---|
| 59 | 66 | char *b_committed_data; |
|---|
| 60 | 67 | |
|---|
| .. | .. |
|---|
| 63 | 70 | * metadata: either the running transaction or the committing |
|---|
| 64 | 71 | * transaction (if there is one). Only applies to buffers on a |
|---|
| 65 | 72 | * transaction's data or metadata journaling list. |
|---|
| 66 | | - * [j_list_lock] [jbd_lock_bh_state()] |
|---|
| 73 | + * [j_list_lock] [b_state_lock] |
|---|
| 67 | 74 | * Either of these locks is enough for reading, both are needed for |
|---|
| 68 | 75 | * changes. |
|---|
| 69 | 76 | */ |
|---|
| .. | .. |
|---|
| 73 | 80 | * Pointer to the running compound transaction which is currently |
|---|
| 74 | 81 | * modifying the buffer's metadata, if there was already a transaction |
|---|
| 75 | 82 | * committing it when the new transaction touched it. |
|---|
| 76 | | - * [t_list_lock] [jbd_lock_bh_state()] |
|---|
| 83 | + * [t_list_lock] [b_state_lock] |
|---|
| 77 | 84 | */ |
|---|
| 78 | 85 | transaction_t *b_next_transaction; |
|---|
| 79 | 86 | |
|---|
| 80 | 87 | /* |
|---|
| 81 | 88 | * Doubly-linked list of buffers on a transaction's data, metadata or |
|---|
| 82 | | - * forget queue. [t_list_lock] [jbd_lock_bh_state()] |
|---|
| 89 | + * forget queue. [t_list_lock] [b_state_lock] |
|---|
| 83 | 90 | */ |
|---|
| 84 | 91 | struct journal_head *b_tnext, *b_tprev; |
|---|
| 85 | 92 | |
|---|