journal-head.h 2.3 KB

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