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

TOMOYO Linux Cross Reference
Linux/fs/jfs/jfs_txnmgr.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /fs/jfs/jfs_txnmgr.h (Version linux-6.11.5) and /fs/jfs/jfs_txnmgr.h (Version linux-6.2.16)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*                                                  2 /*
  3  *   Copyright (C) International Business Mach      3  *   Copyright (C) International Business Machines Corp., 2000-2004
  4  */                                                 4  */
  5 #ifndef _H_JFS_TXNMGR                               5 #ifndef _H_JFS_TXNMGR
  6 #define _H_JFS_TXNMGR                               6 #define _H_JFS_TXNMGR
  7                                                     7 
  8 #include "jfs_logmgr.h"                             8 #include "jfs_logmgr.h"
  9                                                     9 
 10 /*                                                 10 /*
 11  * Hide implementation of TxBlock and TxLock       11  * Hide implementation of TxBlock and TxLock
 12  */                                                12  */
 13 #define tid_to_tblock(tid) (&TxBlock[tid])         13 #define tid_to_tblock(tid) (&TxBlock[tid])
 14                                                    14 
 15 #define lid_to_tlock(lid) (&TxLock[lid])           15 #define lid_to_tlock(lid) (&TxLock[lid])
 16                                                    16 
 17 /*                                                 17 /*
 18  *      transaction block                          18  *      transaction block
 19  */                                                19  */
 20 struct tblock {                                    20 struct tblock {
 21         /*                                         21         /*
 22          * tblock and jbuf_t common area: stru     22          * tblock and jbuf_t common area: struct logsyncblk
 23          *                                         23          *
 24          * the following 5 fields are the same     24          * the following 5 fields are the same as struct logsyncblk
 25          * which is common to tblock and jbuf      25          * which is common to tblock and jbuf to form logsynclist
 26          */                                        26          */
 27         u16 xflag;              /* tx commit t     27         u16 xflag;              /* tx commit type */
 28         u16 flag;               /* tx commit s     28         u16 flag;               /* tx commit state */
 29         lid_t dummy;            /* Must keep s     29         lid_t dummy;            /* Must keep structures common */
 30         s32 lsn;                /* recovery ls     30         s32 lsn;                /* recovery lsn */
 31         struct list_head synclist;      /* log     31         struct list_head synclist;      /* logsynclist link */
 32                                                    32 
 33         /* lock management */                      33         /* lock management */
 34         struct super_block *sb; /* super block     34         struct super_block *sb; /* super block */
 35         lid_t next;             /* index of fi     35         lid_t next;             /* index of first tlock of tid */
 36         lid_t last;             /* index of la     36         lid_t last;             /* index of last tlock of tid */
 37         wait_queue_head_t waitor;       /* tid     37         wait_queue_head_t waitor;       /* tids waiting on this tid */
 38                                                    38 
 39         /* log management */                       39         /* log management */
 40         u32 logtid;             /* log transac     40         u32 logtid;             /* log transaction id */
 41                                                    41 
 42         /* commit management */                    42         /* commit management */
 43         struct list_head cqueue;        /* com     43         struct list_head cqueue;        /* commit queue list */
 44         s32 clsn;               /* commit lsn      44         s32 clsn;               /* commit lsn */
 45         struct lbuf *bp;                           45         struct lbuf *bp;
 46         s32 pn;                 /* commit reco     46         s32 pn;                 /* commit record log page number */
 47         s32 eor;                /* commit reco     47         s32 eor;                /* commit record eor */
 48         wait_queue_head_t gcwait;       /* gro     48         wait_queue_head_t gcwait;       /* group commit event list:
 49                                          * rea     49                                          * ready transactions wait on this
 50                                          * eve     50                                          * event for group commit completion.
 51                                          */        51                                          */
 52         union {                                    52         union {
 53                 struct inode *ip; /* inode bei     53                 struct inode *ip; /* inode being deleted */
 54                 pxd_t ixpxd;    /* pxd of inod     54                 pxd_t ixpxd;    /* pxd of inode extent for created inode */
 55         } u;                                       55         } u;
 56         u32 ino;                /* inode numbe     56         u32 ino;                /* inode number being created */
 57 };                                                 57 };
 58                                                    58 
 59 extern struct tblock *TxBlock;  /* transaction     59 extern struct tblock *TxBlock;  /* transaction block table */
 60                                                    60 
 61 /* commit flags: tblk->xflag */                    61 /* commit flags: tblk->xflag */
 62 #define COMMIT_SYNC     0x0001  /* synchronous     62 #define COMMIT_SYNC     0x0001  /* synchronous commit */
 63 #define COMMIT_FORCE    0x0002  /* force pageo     63 #define COMMIT_FORCE    0x0002  /* force pageout at end of commit */
 64 #define COMMIT_FLUSH    0x0004  /* init flush      64 #define COMMIT_FLUSH    0x0004  /* init flush at end of commit */
 65 #define COMMIT_MAP      0x00f0                     65 #define COMMIT_MAP      0x00f0
 66 #define COMMIT_PMAP     0x0010  /* update pmap     66 #define COMMIT_PMAP     0x0010  /* update pmap */
 67 #define COMMIT_WMAP     0x0020  /* update wmap     67 #define COMMIT_WMAP     0x0020  /* update wmap */
 68 #define COMMIT_PWMAP    0x0040  /* update pwma     68 #define COMMIT_PWMAP    0x0040  /* update pwmap */
 69 #define COMMIT_FREE     0x0f00                     69 #define COMMIT_FREE     0x0f00
 70 #define COMMIT_DELETE   0x0100  /* inode delet     70 #define COMMIT_DELETE   0x0100  /* inode delete */
 71 #define COMMIT_TRUNCATE 0x0200  /* file trunca     71 #define COMMIT_TRUNCATE 0x0200  /* file truncation */
 72 #define COMMIT_CREATE   0x0400  /* inode creat     72 #define COMMIT_CREATE   0x0400  /* inode create */
 73 #define COMMIT_LAZY     0x0800  /* lazy commit     73 #define COMMIT_LAZY     0x0800  /* lazy commit */
 74 #define COMMIT_PAGE     0x1000  /* Identifies      74 #define COMMIT_PAGE     0x1000  /* Identifies element as metapage */
 75 #define COMMIT_INODE    0x2000  /* Identifies      75 #define COMMIT_INODE    0x2000  /* Identifies element as inode */
 76                                                    76 
 77 /* group commit flags tblk->flag: see jfs_logm     77 /* group commit flags tblk->flag: see jfs_logmgr.h */
 78                                                    78 
 79 /*                                                 79 /*
 80  *      transaction lock                           80  *      transaction lock
 81  */                                                81  */
 82 struct tlock {                                     82 struct tlock {
 83         lid_t next;             /* 2: index ne     83         lid_t next;             /* 2: index next lockword on tid locklist
 84                                  *          ne     84                                  *          next lockword on freelist
 85                                  */                85                                  */
 86         tid_t tid;              /* 2: transact     86         tid_t tid;              /* 2: transaction id holding lock */
 87                                                    87 
 88         u16 flag;               /* 2: lock con     88         u16 flag;               /* 2: lock control */
 89         u16 type;               /* 2: log type     89         u16 type;               /* 2: log type */
 90                                                    90 
 91         struct metapage *mp;    /* 4/8: object     91         struct metapage *mp;    /* 4/8: object page buffer locked */
 92         struct inode *ip;       /* 4/8: object     92         struct inode *ip;       /* 4/8: object */
 93         /* (16) */                                 93         /* (16) */
 94                                                    94 
 95         s16 lock[24];           /* 48: overlay     95         s16 lock[24];           /* 48: overlay area */
 96 };                              /* (64) */         96 };                              /* (64) */
 97                                                    97 
 98 extern struct tlock *TxLock;    /* transaction     98 extern struct tlock *TxLock;    /* transaction lock table */
 99                                                    99 
100 /*                                                100 /*
101  * tlock flag                                     101  * tlock flag
102  */                                               102  */
103 /* txLock state */                                103 /* txLock state */
104 #define tlckPAGELOCK            0x8000            104 #define tlckPAGELOCK            0x8000
105 #define tlckINODELOCK           0x4000            105 #define tlckINODELOCK           0x4000
106 #define tlckLINELOCK            0x2000            106 #define tlckLINELOCK            0x2000
107 #define tlckINLINELOCK          0x1000            107 #define tlckINLINELOCK          0x1000
108 /* lmLog state */                                 108 /* lmLog state */
109 #define tlckLOG                 0x0800            109 #define tlckLOG                 0x0800
110 /* updateMap state */                             110 /* updateMap state */
111 #define tlckUPDATEMAP           0x0080            111 #define tlckUPDATEMAP           0x0080
112 #define tlckDIRECTORY           0x0040            112 #define tlckDIRECTORY           0x0040
113 /* freeLock state */                              113 /* freeLock state */
114 #define tlckFREELOCK            0x0008            114 #define tlckFREELOCK            0x0008
115 #define tlckWRITEPAGE           0x0004            115 #define tlckWRITEPAGE           0x0004
116 #define tlckFREEPAGE            0x0002            116 #define tlckFREEPAGE            0x0002
117                                                   117 
118 /*                                                118 /*
119  * tlock type                                     119  * tlock type
120  */                                               120  */
121 #define tlckTYPE                0xfe00            121 #define tlckTYPE                0xfe00
122 #define tlckINODE               0x8000            122 #define tlckINODE               0x8000
123 #define tlckXTREE               0x4000            123 #define tlckXTREE               0x4000
124 #define tlckDTREE               0x2000            124 #define tlckDTREE               0x2000
125 #define tlckMAP                 0x1000            125 #define tlckMAP                 0x1000
126 #define tlckEA                  0x0800            126 #define tlckEA                  0x0800
127 #define tlckACL                 0x0400            127 #define tlckACL                 0x0400
128 #define tlckDATA                0x0200            128 #define tlckDATA                0x0200
129 #define tlckBTROOT              0x0100            129 #define tlckBTROOT              0x0100
130                                                   130 
131 #define tlckOPERATION           0x00ff            131 #define tlckOPERATION           0x00ff
132 #define tlckGROW                0x0001  /* fil    132 #define tlckGROW                0x0001  /* file grow */
133 #define tlckREMOVE              0x0002  /* fil    133 #define tlckREMOVE              0x0002  /* file delete */
134 #define tlckTRUNCATE            0x0004  /* fil    134 #define tlckTRUNCATE            0x0004  /* file truncate */
135 #define tlckRELOCATE            0x0008  /* fil    135 #define tlckRELOCATE            0x0008  /* file/directory relocate */
136 #define tlckENTRY               0x0001  /* dir    136 #define tlckENTRY               0x0001  /* directory insert/delete */
137 #define tlckEXTEND              0x0002  /* dir    137 #define tlckEXTEND              0x0002  /* directory extend in-line */
138 #define tlckSPLIT               0x0010  /* spl    138 #define tlckSPLIT               0x0010  /* splited page */
139 #define tlckNEW                 0x0020  /* new    139 #define tlckNEW                 0x0020  /* new page from split */
140 #define tlckFREE                0x0040  /* fre    140 #define tlckFREE                0x0040  /* free page */
141 #define tlckRELINK              0x0080  /* upd    141 #define tlckRELINK              0x0080  /* update sibling pointer */
142                                                   142 
143 /*                                                143 /*
144  *      linelock for lmLog()                      144  *      linelock for lmLog()
145  *                                                145  *
146  * note: linelock and its variations are overl    146  * note: linelock and its variations are overlaid
147  * at tlock.lock: watch for alignment;            147  * at tlock.lock: watch for alignment;
148  */                                               148  */
149 struct lv {                                       149 struct lv {
150         u8 offset;              /* 1: */          150         u8 offset;              /* 1: */
151         u8 length;              /* 1: */          151         u8 length;              /* 1: */
152 };                              /* (2) */         152 };                              /* (2) */
153                                                   153 
154 #define TLOCKSHORT      20                        154 #define TLOCKSHORT      20
155 #define TLOCKLONG       28                        155 #define TLOCKLONG       28
156                                                   156 
157 struct linelock {                                 157 struct linelock {
158         lid_t next;             /* 2: next lin    158         lid_t next;             /* 2: next linelock */
159                                                   159 
160         s8 maxcnt;              /* 1: */          160         s8 maxcnt;              /* 1: */
161         s8 index;               /* 1: */          161         s8 index;               /* 1: */
162                                                   162 
163         u16 flag;               /* 2: */          163         u16 flag;               /* 2: */
164         u8 type;                /* 1: */          164         u8 type;                /* 1: */
165         u8 l2linesize;          /* 1: log2 of     165         u8 l2linesize;          /* 1: log2 of linesize */
166         /* (8) */                                 166         /* (8) */
167                                                   167 
168         struct lv lv[20];       /* 40: */         168         struct lv lv[20];       /* 40: */
169 };                              /* (48) */        169 };                              /* (48) */
170                                                   170 
171 #define dt_lock linelock                          171 #define dt_lock linelock
172                                                   172 
173 struct xtlock {                                   173 struct xtlock {
174         lid_t next;             /* 2: */          174         lid_t next;             /* 2: */
175                                                   175 
176         s8 maxcnt;              /* 1: */          176         s8 maxcnt;              /* 1: */
177         s8 index;               /* 1: */          177         s8 index;               /* 1: */
178                                                   178 
179         u16 flag;               /* 2: */          179         u16 flag;               /* 2: */
180         u8 type;                /* 1: */          180         u8 type;                /* 1: */
181         u8 l2linesize;          /* 1: log2 of     181         u8 l2linesize;          /* 1: log2 of linesize */
182                                 /* (8) */         182                                 /* (8) */
183                                                   183 
184         struct lv header;       /* 2: */          184         struct lv header;       /* 2: */
185         struct lv lwm;          /* 2: low wate    185         struct lv lwm;          /* 2: low water mark */
186         struct lv hwm;          /* 2: high wat    186         struct lv hwm;          /* 2: high water mark */
187         struct lv twm;          /* 2: */          187         struct lv twm;          /* 2: */
188                                 /* (16) */        188                                 /* (16) */
189                                                   189 
190         s32 pxdlock[8];         /* 32: */         190         s32 pxdlock[8];         /* 32: */
191 };                              /* (48) */        191 };                              /* (48) */
192                                                   192 
193                                                   193 
194 /*                                                194 /*
195  *      maplock for txUpdateMap()                 195  *      maplock for txUpdateMap()
196  *                                                196  *
197  * note: maplock and its variations are overla    197  * note: maplock and its variations are overlaid
198  * at tlock.lock/linelock: watch for alignment    198  * at tlock.lock/linelock: watch for alignment;
199  * N.B. next field may be set by linelock, and    199  * N.B. next field may be set by linelock, and should not
200  * be modified by maplock;                        200  * be modified by maplock;
201  * N.B. index of the first pxdlock specifies i    201  * N.B. index of the first pxdlock specifies index of next
202  * free maplock (i.e., number of maplock) in t    202  * free maplock (i.e., number of maplock) in the tlock;
203  */                                               203  */
204 struct maplock {                                  204 struct maplock {
205         lid_t next;             /* 2: */          205         lid_t next;             /* 2: */
206                                                   206 
207         u8 maxcnt;              /* 2: */          207         u8 maxcnt;              /* 2: */
208         u8 index;               /* 2: next fre    208         u8 index;               /* 2: next free maplock index */
209                                                   209 
210         u16 flag;               /* 2: */          210         u16 flag;               /* 2: */
211         u8 type;                /* 1: */          211         u8 type;                /* 1: */
212         u8 count;               /* 1: number o    212         u8 count;               /* 1: number of pxd/xad */
213                                 /* (8) */         213                                 /* (8) */
214                                                   214 
215         pxd_t pxd;              /* 8: */          215         pxd_t pxd;              /* 8: */
216 };                              /* (16): */       216 };                              /* (16): */
217                                                   217 
218 /* maplock flag */                                218 /* maplock flag */
219 #define mlckALLOC               0x00f0            219 #define mlckALLOC               0x00f0
220 #define mlckALLOCXADLIST        0x0080            220 #define mlckALLOCXADLIST        0x0080
221 #define mlckALLOCPXDLIST        0x0040            221 #define mlckALLOCPXDLIST        0x0040
222 #define mlckALLOCXAD            0x0020            222 #define mlckALLOCXAD            0x0020
223 #define mlckALLOCPXD            0x0010            223 #define mlckALLOCPXD            0x0010
224 #define mlckFREE                0x000f            224 #define mlckFREE                0x000f
225 #define mlckFREEXADLIST         0x0008            225 #define mlckFREEXADLIST         0x0008
226 #define mlckFREEPXDLIST         0x0004            226 #define mlckFREEPXDLIST         0x0004
227 #define mlckFREEXAD             0x0002            227 #define mlckFREEXAD             0x0002
228 #define mlckFREEPXD             0x0001            228 #define mlckFREEPXD             0x0001
229                                                   229 
230 #define pxd_lock        maplock                   230 #define pxd_lock        maplock
231                                                   231 
232 struct xdlistlock {                               232 struct xdlistlock {
233         lid_t next;             /* 2: */          233         lid_t next;             /* 2: */
234                                                   234 
235         u8 maxcnt;              /* 2: */          235         u8 maxcnt;              /* 2: */
236         u8 index;               /* 2: */          236         u8 index;               /* 2: */
237                                                   237 
238         u16 flag;               /* 2: */          238         u16 flag;               /* 2: */
239         u8 type;                /* 1: */          239         u8 type;                /* 1: */
240         u8 count;               /* 1: number o    240         u8 count;               /* 1: number of pxd/xad */
241                                 /* (8) */         241                                 /* (8) */
242                                                   242 
243         /*                                        243         /*
244          * We need xdlist to be 64 bits (8 byt    244          * We need xdlist to be 64 bits (8 bytes), regardless of
245          * whether void * is 32 or 64 bits        245          * whether void * is 32 or 64 bits
246          */                                       246          */
247         union {                                   247         union {
248                 void *_xdlist;  /* pxd/xad lis    248                 void *_xdlist;  /* pxd/xad list */
249                 s64 pad;        /* 8: Force 64    249                 s64 pad;        /* 8: Force 64-bit xdlist size */
250         } union64;                                250         } union64;
251 };                              /* (16): */       251 };                              /* (16): */
252                                                   252 
253 #define xdlist union64._xdlist                    253 #define xdlist union64._xdlist
254                                                   254 
255 /*                                                255 /*
256  *      commit                                    256  *      commit
257  *                                                257  *
258  * parameter to the commit manager routines       258  * parameter to the commit manager routines
259  */                                               259  */
260 struct commit {                                   260 struct commit {
261         tid_t tid;              /* tid = index    261         tid_t tid;              /* tid = index of tblock */
262         int flag;               /* flags */       262         int flag;               /* flags */
263         struct jfs_log *log;    /* log */         263         struct jfs_log *log;    /* log */
264         struct super_block *sb; /* superblock     264         struct super_block *sb; /* superblock */
265                                                   265 
266         int nip;                /* number of e    266         int nip;                /* number of entries in iplist */
267         struct inode **iplist;  /* list of poi    267         struct inode **iplist;  /* list of pointers to inodes */
268                                                   268 
269         /* log record descriptor on 64-bit bou    269         /* log record descriptor on 64-bit boundary */
270         struct lrd lrd;         /* : log recor    270         struct lrd lrd;         /* : log record descriptor */
271 };                                                271 };
272                                                   272 
273 /*                                                273 /*
274  * external declarations                          274  * external declarations
275  */                                               275  */
276 extern int jfs_tlocks_low;                        276 extern int jfs_tlocks_low;
277                                                   277 
278 extern int txInit(void);                          278 extern int txInit(void);
279 extern void txExit(void);                         279 extern void txExit(void);
280 extern struct tlock *txLock(tid_t, struct inod    280 extern struct tlock *txLock(tid_t, struct inode *, struct metapage *, int);
281 extern struct tlock *txMaplock(tid_t, struct i    281 extern struct tlock *txMaplock(tid_t, struct inode *, int);
282 extern int txCommit(tid_t, int, struct inode *    282 extern int txCommit(tid_t, int, struct inode **, int);
283 extern tid_t txBegin(struct super_block *, int    283 extern tid_t txBegin(struct super_block *, int);
284 extern void txBeginAnon(struct super_block *);    284 extern void txBeginAnon(struct super_block *);
285 extern void txEnd(tid_t);                         285 extern void txEnd(tid_t);
286 extern void txAbort(tid_t, int);                  286 extern void txAbort(tid_t, int);
287 extern struct linelock *txLinelock(struct line    287 extern struct linelock *txLinelock(struct linelock *);
288 extern void txFreeMap(struct inode *, struct m    288 extern void txFreeMap(struct inode *, struct maplock *, struct tblock *, int);
289 extern void txEA(tid_t, struct inode *, dxd_t     289 extern void txEA(tid_t, struct inode *, dxd_t *, dxd_t *);
290 extern void txFreelock(struct inode *);           290 extern void txFreelock(struct inode *);
291 extern int lmLog(struct jfs_log *, struct tblo    291 extern int lmLog(struct jfs_log *, struct tblock *, struct lrd *,
292                  struct tlock *);                 292                  struct tlock *);
293 extern void txQuiesce(struct super_block *);      293 extern void txQuiesce(struct super_block *);
294 extern void txResume(struct super_block *);       294 extern void txResume(struct super_block *);
295 extern void txLazyUnlock(struct tblock *);        295 extern void txLazyUnlock(struct tblock *);
296 extern int jfs_lazycommit(void *);                296 extern int jfs_lazycommit(void *);
297 extern int jfs_sync(void *);                      297 extern int jfs_sync(void *);
298 #endif                          /* _H_JFS_TXNM    298 #endif                          /* _H_JFS_TXNMGR */
299                                                   299 

~ [ 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