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