journal-head.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * include/linux/journal-head.h
  3. *
  4. * buffer_head fields for JBD
  5. *
  6. * 27 May 2001 Andrew Morton
  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. * This feild tracks the last transaction id in which this buffer
  36. * has been cowed
  37. * [jbd_lock_bh_state()]
  38. */
  39. unsigned b_cow_tid;
  40. /*
  41. * Copy of the buffer data frozen for writing to the log.
  42. * [jbd_lock_bh_state()]
  43. */
  44. char *b_frozen_data;
  45. /*
  46. * Pointer to a saved copy of the buffer containing no uncommitted
  47. * deallocation references, so that allocations can avoid overwriting
  48. * uncommitted deletes. [jbd_lock_bh_state()]
  49. */
  50. char *b_committed_data;
  51. /*
  52. * Pointer to the compound transaction which owns this buffer's
  53. * metadata: either the running transaction or the committing
  54. * transaction (if there is one). Only applies to buffers on a
  55. * transaction's data or metadata journaling list.
  56. * [j_list_lock] [jbd_lock_bh_state()]
  57. */
  58. transaction_t *b_transaction;
  59. /*
  60. * Pointer to the running compound transaction which is currently
  61. * modifying the buffer's metadata, if there was already a transaction
  62. * committing it when the new transaction touched it.
  63. * [t_list_lock] [jbd_lock_bh_state()]
  64. */
  65. transaction_t *b_next_transaction;
  66. /*
  67. * Doubly-linked list of buffers on a transaction's data, metadata or
  68. * forget queue. [t_list_lock] [jbd_lock_bh_state()]
  69. */
  70. struct journal_head *b_tnext, *b_tprev;
  71. /*
  72. * Pointer to the compound transaction against which this buffer
  73. * is checkpointed. Only dirty buffers can be checkpointed.
  74. * [j_list_lock]
  75. */
  76. transaction_t *b_cp_transaction;
  77. /*
  78. * Doubly-linked list of buffers still remaining to be flushed
  79. * before an old transaction can be checkpointed.
  80. * [j_list_lock]
  81. */
  82. struct journal_head *b_cpnext, *b_cpprev;
  83. /* Trigger type */
  84. struct jbd2_buffer_trigger_type *b_triggers;
  85. /* Trigger type for the committing transaction's frozen data */
  86. struct jbd2_buffer_trigger_type *b_frozen_triggers;
  87. };
  88. #endif /* JOURNAL_HEAD_H_INCLUDED */