~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/journal-head.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * include/linux/journal-head.h
  4  *
  5  * buffer_head fields for JBD
  6  *
  7  * 27 May 2001 Andrew Morton
  8  *      Created - pulled out of fs.h
  9  */
 10 
 11 #ifndef JOURNAL_HEAD_H_INCLUDED
 12 #define JOURNAL_HEAD_H_INCLUDED
 13 
 14 #include <linux/spinlock.h>
 15 
 16 typedef unsigned int            tid_t;          /* Unique transaction ID */
 17 typedef struct transaction_s    transaction_t;  /* Compound transaction type */
 18 
 19 
 20 struct buffer_head;
 21 
 22 struct journal_head {
 23         /*
 24          * Points back to our buffer_head. [jbd_lock_bh_journal_head()]
 25          */
 26         struct buffer_head *b_bh;
 27 
 28         /*
 29          * Protect the buffer head state
 30          */
 31         spinlock_t b_state_lock;
 32 
 33         /*
 34          * Reference count - see description in journal.c
 35          * [jbd_lock_bh_journal_head()]
 36          */
 37         int b_jcount;
 38 
 39         /*
 40          * Journalling list for this buffer [b_state_lock]
 41          * NOTE: We *cannot* combine this with b_modified into a bitfield
 42          * as gcc would then (which the C standard allows but which is
 43          * very unuseful) make 64-bit accesses to the bitfield and clobber
 44          * b_jcount if its update races with bitfield modification.
 45          */
 46         unsigned b_jlist;
 47 
 48         /*
 49          * This flag signals the buffer has been modified by
 50          * the currently running transaction
 51          * [b_state_lock]
 52          */
 53         unsigned b_modified;
 54 
 55         /*
 56          * Copy of the buffer data frozen for writing to the log.
 57          * [b_state_lock]
 58          */
 59         char *b_frozen_data;
 60 
 61         /*
 62          * Pointer to a saved copy of the buffer containing no uncommitted
 63          * deallocation references, so that allocations can avoid overwriting
 64          * uncommitted deletes. [b_state_lock]
 65          */
 66         char *b_committed_data;
 67 
 68         /*
 69          * Pointer to the compound transaction which owns this buffer's
 70          * metadata: either the running transaction or the committing
 71          * transaction (if there is one).  Only applies to buffers on a
 72          * transaction's data or metadata journaling list.
 73          * [j_list_lock] [b_state_lock]
 74          * Either of these locks is enough for reading, both are needed for
 75          * changes.
 76          */
 77         transaction_t *b_transaction;
 78 
 79         /*
 80          * Pointer to the running compound transaction which is currently
 81          * modifying the buffer's metadata, if there was already a transaction
 82          * committing it when the new transaction touched it.
 83          * [t_list_lock] [b_state_lock]
 84          */
 85         transaction_t *b_next_transaction;
 86 
 87         /*
 88          * Doubly-linked list of buffers on a transaction's data, metadata or
 89          * forget queue. [t_list_lock] [b_state_lock]
 90          */
 91         struct journal_head *b_tnext, *b_tprev;
 92 
 93         /*
 94          * Pointer to the compound transaction against which this buffer
 95          * is checkpointed.  Only dirty buffers can be checkpointed.
 96          * [j_list_lock]
 97          */
 98         transaction_t *b_cp_transaction;
 99 
100         /*
101          * Doubly-linked list of buffers still remaining to be flushed
102          * before an old transaction can be checkpointed.
103          * [j_list_lock]
104          */
105         struct journal_head *b_cpnext, *b_cpprev;
106 
107         /* Trigger type */
108         struct jbd2_buffer_trigger_type *b_triggers;
109 
110         /* Trigger type for the committing transaction's frozen data */
111         struct jbd2_buffer_trigger_type *b_frozen_triggers;
112 };
113 
114 #endif          /* JOURNAL_HEAD_H_INCLUDED */
115 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php