aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_txnmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_txnmgr.c')
-rw-r--r--fs/jfs/jfs_txnmgr.c286
1 files changed, 143 insertions, 143 deletions
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 25430d0b0d59..f2dc4b986392 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20/* 20/*
21 * jfs_txnmgr.c: transaction manager 21 * jfs_txnmgr.c: transaction manager
22 * 22 *
23 * notes: 23 * notes:
24 * transaction starts with txBegin() and ends with txCommit() 24 * transaction starts with txBegin() and ends with txCommit()
@@ -60,7 +60,7 @@
60#include "jfs_debug.h" 60#include "jfs_debug.h"
61 61
62/* 62/*
63 * transaction management structures 63 * transaction management structures
64 */ 64 */
65static struct { 65static struct {
66 int freetid; /* index of a free tid structure */ 66 int freetid; /* index of a free tid structure */
@@ -103,19 +103,19 @@ module_param(nTxLock, int, 0);
103MODULE_PARM_DESC(nTxLock, 103MODULE_PARM_DESC(nTxLock,
104 "Number of transaction locks (max:65536)"); 104 "Number of transaction locks (max:65536)");
105 105
106struct tblock *TxBlock; /* transaction block table */ 106struct tblock *TxBlock; /* transaction block table */
107static int TxLockLWM; /* Low water mark for number of txLocks used */ 107static int TxLockLWM; /* Low water mark for number of txLocks used */
108static int TxLockHWM; /* High water mark for number of txLocks used */ 108static int TxLockHWM; /* High water mark for number of txLocks used */
109static int TxLockVHWM; /* Very High water mark */ 109static int TxLockVHWM; /* Very High water mark */
110struct tlock *TxLock; /* transaction lock table */ 110struct tlock *TxLock; /* transaction lock table */
111 111
112/* 112/*
113 * transaction management lock 113 * transaction management lock
114 */ 114 */
115static DEFINE_SPINLOCK(jfsTxnLock); 115static DEFINE_SPINLOCK(jfsTxnLock);
116 116
117#define TXN_LOCK() spin_lock(&jfsTxnLock) 117#define TXN_LOCK() spin_lock(&jfsTxnLock)
118#define TXN_UNLOCK() spin_unlock(&jfsTxnLock) 118#define TXN_UNLOCK() spin_unlock(&jfsTxnLock)
119 119
120#define LAZY_LOCK_INIT() spin_lock_init(&TxAnchor.LazyLock); 120#define LAZY_LOCK_INIT() spin_lock_init(&TxAnchor.LazyLock);
121#define LAZY_LOCK(flags) spin_lock_irqsave(&TxAnchor.LazyLock, flags) 121#define LAZY_LOCK(flags) spin_lock_irqsave(&TxAnchor.LazyLock, flags)
@@ -148,7 +148,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event)
148#define TXN_WAKEUP(event) wake_up_all(event) 148#define TXN_WAKEUP(event) wake_up_all(event)
149 149
150/* 150/*
151 * statistics 151 * statistics
152 */ 152 */
153static struct { 153static struct {
154 tid_t maxtid; /* 4: biggest tid ever used */ 154 tid_t maxtid; /* 4: biggest tid ever used */
@@ -181,8 +181,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
181static void LogSyncRelease(struct metapage * mp); 181static void LogSyncRelease(struct metapage * mp);
182 182
183/* 183/*
184 * transaction block/lock management 184 * transaction block/lock management
185 * --------------------------------- 185 * ---------------------------------
186 */ 186 */
187 187
188/* 188/*
@@ -227,9 +227,9 @@ static void txLockFree(lid_t lid)
227} 227}
228 228
229/* 229/*
230 * NAME: txInit() 230 * NAME: txInit()
231 * 231 *
232 * FUNCTION: initialize transaction management structures 232 * FUNCTION: initialize transaction management structures
233 * 233 *
234 * RETURN: 234 * RETURN:
235 * 235 *
@@ -333,9 +333,9 @@ int txInit(void)
333} 333}
334 334
335/* 335/*
336 * NAME: txExit() 336 * NAME: txExit()
337 * 337 *
338 * FUNCTION: clean up when module is unloaded 338 * FUNCTION: clean up when module is unloaded
339 */ 339 */
340void txExit(void) 340void txExit(void)
341{ 341{
@@ -346,12 +346,12 @@ void txExit(void)
346} 346}
347 347
348/* 348/*
349 * NAME: txBegin() 349 * NAME: txBegin()
350 * 350 *
351 * FUNCTION: start a transaction. 351 * FUNCTION: start a transaction.
352 * 352 *
353 * PARAMETER: sb - superblock 353 * PARAMETER: sb - superblock
354 * flag - force for nested tx; 354 * flag - force for nested tx;
355 * 355 *
356 * RETURN: tid - transaction id 356 * RETURN: tid - transaction id
357 * 357 *
@@ -447,13 +447,13 @@ tid_t txBegin(struct super_block *sb, int flag)
447} 447}
448 448
449/* 449/*
450 * NAME: txBeginAnon() 450 * NAME: txBeginAnon()
451 * 451 *
452 * FUNCTION: start an anonymous transaction. 452 * FUNCTION: start an anonymous transaction.
453 * Blocks if logsync or available tlocks are low to prevent 453 * Blocks if logsync or available tlocks are low to prevent
454 * anonymous tlocks from depleting supply. 454 * anonymous tlocks from depleting supply.
455 * 455 *
456 * PARAMETER: sb - superblock 456 * PARAMETER: sb - superblock
457 * 457 *
458 * RETURN: none 458 * RETURN: none
459 */ 459 */
@@ -489,11 +489,11 @@ void txBeginAnon(struct super_block *sb)
489} 489}
490 490
491/* 491/*
492 * txEnd() 492 * txEnd()
493 * 493 *
494 * function: free specified transaction block. 494 * function: free specified transaction block.
495 * 495 *
496 * logsync barrier processing: 496 * logsync barrier processing:
497 * 497 *
498 * serialization: 498 * serialization:
499 */ 499 */
@@ -577,13 +577,13 @@ wakeup:
577} 577}
578 578
579/* 579/*
580 * txLock() 580 * txLock()
581 * 581 *
582 * function: acquire a transaction lock on the specified <mp> 582 * function: acquire a transaction lock on the specified <mp>
583 * 583 *
584 * parameter: 584 * parameter:
585 * 585 *
586 * return: transaction lock id 586 * return: transaction lock id
587 * 587 *
588 * serialization: 588 * serialization:
589 */ 589 */
@@ -857,17 +857,17 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
857} 857}
858 858
859/* 859/*
860 * NAME: txRelease() 860 * NAME: txRelease()
861 * 861 *
862 * FUNCTION: Release buffers associated with transaction locks, but don't 862 * FUNCTION: Release buffers associated with transaction locks, but don't
863 * mark homeok yet. The allows other transactions to modify 863 * mark homeok yet. The allows other transactions to modify
864 * buffers, but won't let them go to disk until commit record 864 * buffers, but won't let them go to disk until commit record
865 * actually gets written. 865 * actually gets written.
866 * 866 *
867 * PARAMETER: 867 * PARAMETER:
868 * tblk - 868 * tblk -
869 * 869 *
870 * RETURN: Errors from subroutines. 870 * RETURN: Errors from subroutines.
871 */ 871 */
872static void txRelease(struct tblock * tblk) 872static void txRelease(struct tblock * tblk)
873{ 873{
@@ -896,10 +896,10 @@ static void txRelease(struct tblock * tblk)
896} 896}
897 897
898/* 898/*
899 * NAME: txUnlock() 899 * NAME: txUnlock()
900 * 900 *
901 * FUNCTION: Initiates pageout of pages modified by tid in journalled 901 * FUNCTION: Initiates pageout of pages modified by tid in journalled
902 * objects and frees their lockwords. 902 * objects and frees their lockwords.
903 */ 903 */
904static void txUnlock(struct tblock * tblk) 904static void txUnlock(struct tblock * tblk)
905{ 905{
@@ -983,10 +983,10 @@ static void txUnlock(struct tblock * tblk)
983} 983}
984 984
985/* 985/*
986 * txMaplock() 986 * txMaplock()
987 * 987 *
988 * function: allocate a transaction lock for freed page/entry; 988 * function: allocate a transaction lock for freed page/entry;
989 * for freed page, maplock is used as xtlock/dtlock type; 989 * for freed page, maplock is used as xtlock/dtlock type;
990 */ 990 */
991struct tlock *txMaplock(tid_t tid, struct inode *ip, int type) 991struct tlock *txMaplock(tid_t tid, struct inode *ip, int type)
992{ 992{
@@ -1057,7 +1057,7 @@ struct tlock *txMaplock(tid_t tid, struct inode *ip, int type)
1057} 1057}
1058 1058
1059/* 1059/*
1060 * txLinelock() 1060 * txLinelock()
1061 * 1061 *
1062 * function: allocate a transaction lock for log vector list 1062 * function: allocate a transaction lock for log vector list
1063 */ 1063 */
@@ -1092,39 +1092,39 @@ struct linelock *txLinelock(struct linelock * tlock)
1092} 1092}
1093 1093
1094/* 1094/*
1095 * transaction commit management 1095 * transaction commit management
1096 * ----------------------------- 1096 * -----------------------------
1097 */ 1097 */
1098 1098
1099/* 1099/*
1100 * NAME: txCommit() 1100 * NAME: txCommit()
1101 * 1101 *
1102 * FUNCTION: commit the changes to the objects specified in 1102 * FUNCTION: commit the changes to the objects specified in
1103 * clist. For journalled segments only the 1103 * clist. For journalled segments only the
1104 * changes of the caller are committed, ie by tid. 1104 * changes of the caller are committed, ie by tid.
1105 * for non-journalled segments the data are flushed to 1105 * for non-journalled segments the data are flushed to
1106 * disk and then the change to the disk inode and indirect 1106 * disk and then the change to the disk inode and indirect
1107 * blocks committed (so blocks newly allocated to the 1107 * blocks committed (so blocks newly allocated to the
1108 * segment will be made a part of the segment atomically). 1108 * segment will be made a part of the segment atomically).
1109 * 1109 *
1110 * all of the segments specified in clist must be in 1110 * all of the segments specified in clist must be in
1111 * one file system. no more than 6 segments are needed 1111 * one file system. no more than 6 segments are needed
1112 * to handle all unix svcs. 1112 * to handle all unix svcs.
1113 * 1113 *
1114 * if the i_nlink field (i.e. disk inode link count) 1114 * if the i_nlink field (i.e. disk inode link count)
1115 * is zero, and the type of inode is a regular file or 1115 * is zero, and the type of inode is a regular file or
1116 * directory, or symbolic link , the inode is truncated 1116 * directory, or symbolic link , the inode is truncated
1117 * to zero length. the truncation is committed but the 1117 * to zero length. the truncation is committed but the
1118 * VM resources are unaffected until it is closed (see 1118 * VM resources are unaffected until it is closed (see
1119 * iput and iclose). 1119 * iput and iclose).
1120 * 1120 *
1121 * PARAMETER: 1121 * PARAMETER:
1122 * 1122 *
1123 * RETURN: 1123 * RETURN:
1124 * 1124 *
1125 * serialization: 1125 * serialization:
1126 * on entry the inode lock on each segment is assumed 1126 * on entry the inode lock on each segment is assumed
1127 * to be held. 1127 * to be held.
1128 * 1128 *
1129 * i/o error: 1129 * i/o error:
1130 */ 1130 */
@@ -1175,7 +1175,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1175 if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0) 1175 if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0)
1176 tblk->xflag |= COMMIT_LAZY; 1176 tblk->xflag |= COMMIT_LAZY;
1177 /* 1177 /*
1178 * prepare non-journaled objects for commit 1178 * prepare non-journaled objects for commit
1179 * 1179 *
1180 * flush data pages of non-journaled file 1180 * flush data pages of non-journaled file
1181 * to prevent the file getting non-initialized disk blocks 1181 * to prevent the file getting non-initialized disk blocks
@@ -1186,7 +1186,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1186 cd.nip = nip; 1186 cd.nip = nip;
1187 1187
1188 /* 1188 /*
1189 * acquire transaction lock on (on-disk) inodes 1189 * acquire transaction lock on (on-disk) inodes
1190 * 1190 *
1191 * update on-disk inode from in-memory inode 1191 * update on-disk inode from in-memory inode
1192 * acquiring transaction locks for AFTER records 1192 * acquiring transaction locks for AFTER records
@@ -1262,7 +1262,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1262 } 1262 }
1263 1263
1264 /* 1264 /*
1265 * write log records from transaction locks 1265 * write log records from transaction locks
1266 * 1266 *
1267 * txUpdateMap() resets XAD_NEW in XAD. 1267 * txUpdateMap() resets XAD_NEW in XAD.
1268 */ 1268 */
@@ -1294,7 +1294,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1294 !test_cflag(COMMIT_Nolink, tblk->u.ip))); 1294 !test_cflag(COMMIT_Nolink, tblk->u.ip)));
1295 1295
1296 /* 1296 /*
1297 * write COMMIT log record 1297 * write COMMIT log record
1298 */ 1298 */
1299 lrd->type = cpu_to_le16(LOG_COMMIT); 1299 lrd->type = cpu_to_le16(LOG_COMMIT);
1300 lrd->length = 0; 1300 lrd->length = 0;
@@ -1303,7 +1303,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1303 lmGroupCommit(log, tblk); 1303 lmGroupCommit(log, tblk);
1304 1304
1305 /* 1305 /*
1306 * - transaction is now committed - 1306 * - transaction is now committed -
1307 */ 1307 */
1308 1308
1309 /* 1309 /*
@@ -1314,11 +1314,11 @@ int txCommit(tid_t tid, /* transaction identifier */
1314 txForce(tblk); 1314 txForce(tblk);
1315 1315
1316 /* 1316 /*
1317 * update allocation map. 1317 * update allocation map.
1318 * 1318 *
1319 * update inode allocation map and inode: 1319 * update inode allocation map and inode:
1320 * free pager lock on memory object of inode if any. 1320 * free pager lock on memory object of inode if any.
1321 * update block allocation map. 1321 * update block allocation map.
1322 * 1322 *
1323 * txUpdateMap() resets XAD_NEW in XAD. 1323 * txUpdateMap() resets XAD_NEW in XAD.
1324 */ 1324 */
@@ -1326,7 +1326,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1326 txUpdateMap(tblk); 1326 txUpdateMap(tblk);
1327 1327
1328 /* 1328 /*
1329 * free transaction locks and pageout/free pages 1329 * free transaction locks and pageout/free pages
1330 */ 1330 */
1331 txRelease(tblk); 1331 txRelease(tblk);
1332 1332
@@ -1335,7 +1335,7 @@ int txCommit(tid_t tid, /* transaction identifier */
1335 1335
1336 1336
1337 /* 1337 /*
1338 * reset in-memory object state 1338 * reset in-memory object state
1339 */ 1339 */
1340 for (k = 0; k < cd.nip; k++) { 1340 for (k = 0; k < cd.nip; k++) {
1341 ip = cd.iplist[k]; 1341 ip = cd.iplist[k];
@@ -1358,11 +1358,11 @@ int txCommit(tid_t tid, /* transaction identifier */
1358} 1358}
1359 1359
1360/* 1360/*
1361 * NAME: txLog() 1361 * NAME: txLog()
1362 * 1362 *
1363 * FUNCTION: Writes AFTER log records for all lines modified 1363 * FUNCTION: Writes AFTER log records for all lines modified
1364 * by tid for segments specified by inodes in comdata. 1364 * by tid for segments specified by inodes in comdata.
1365 * Code assumes only WRITELOCKS are recorded in lockwords. 1365 * Code assumes only WRITELOCKS are recorded in lockwords.
1366 * 1366 *
1367 * PARAMETERS: 1367 * PARAMETERS:
1368 * 1368 *
@@ -1421,12 +1421,12 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
1421} 1421}
1422 1422
1423/* 1423/*
1424 * diLog() 1424 * diLog()
1425 * 1425 *
1426 * function: log inode tlock and format maplock to update bmap; 1426 * function: log inode tlock and format maplock to update bmap;
1427 */ 1427 */
1428static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 1428static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1429 struct tlock * tlck, struct commit * cd) 1429 struct tlock * tlck, struct commit * cd)
1430{ 1430{
1431 int rc = 0; 1431 int rc = 0;
1432 struct metapage *mp; 1432 struct metapage *mp;
@@ -1442,7 +1442,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1442 pxd = &lrd->log.redopage.pxd; 1442 pxd = &lrd->log.redopage.pxd;
1443 1443
1444 /* 1444 /*
1445 * inode after image 1445 * inode after image
1446 */ 1446 */
1447 if (tlck->type & tlckENTRY) { 1447 if (tlck->type & tlckENTRY) {
1448 /* log after-image for logredo(): */ 1448 /* log after-image for logredo(): */
@@ -1456,7 +1456,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1456 tlck->flag |= tlckWRITEPAGE; 1456 tlck->flag |= tlckWRITEPAGE;
1457 } else if (tlck->type & tlckFREE) { 1457 } else if (tlck->type & tlckFREE) {
1458 /* 1458 /*
1459 * free inode extent 1459 * free inode extent
1460 * 1460 *
1461 * (pages of the freed inode extent have been invalidated and 1461 * (pages of the freed inode extent have been invalidated and
1462 * a maplock for free of the extent has been formatted at 1462 * a maplock for free of the extent has been formatted at
@@ -1498,7 +1498,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1498 jfs_err("diLog: UFO type tlck:0x%p", tlck); 1498 jfs_err("diLog: UFO type tlck:0x%p", tlck);
1499#ifdef _JFS_WIP 1499#ifdef _JFS_WIP
1500 /* 1500 /*
1501 * alloc/free external EA extent 1501 * alloc/free external EA extent
1502 * 1502 *
1503 * a maplock for txUpdateMap() to update bPWMAP for alloc/free 1503 * a maplock for txUpdateMap() to update bPWMAP for alloc/free
1504 * of the extent has been formatted at txLock() time; 1504 * of the extent has been formatted at txLock() time;
@@ -1534,9 +1534,9 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1534} 1534}
1535 1535
1536/* 1536/*
1537 * dataLog() 1537 * dataLog()
1538 * 1538 *
1539 * function: log data tlock 1539 * function: log data tlock
1540 */ 1540 */
1541static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 1541static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1542 struct tlock * tlck) 1542 struct tlock * tlck)
@@ -1580,9 +1580,9 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1580} 1580}
1581 1581
1582/* 1582/*
1583 * dtLog() 1583 * dtLog()
1584 * 1584 *
1585 * function: log dtree tlock and format maplock to update bmap; 1585 * function: log dtree tlock and format maplock to update bmap;
1586 */ 1586 */
1587static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 1587static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1588 struct tlock * tlck) 1588 struct tlock * tlck)
@@ -1603,10 +1603,10 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1603 lrd->log.redopage.type |= cpu_to_le16(LOG_BTROOT); 1603 lrd->log.redopage.type |= cpu_to_le16(LOG_BTROOT);
1604 1604
1605 /* 1605 /*
1606 * page extension via relocation: entry insertion; 1606 * page extension via relocation: entry insertion;
1607 * page extension in-place: entry insertion; 1607 * page extension in-place: entry insertion;
1608 * new right page from page split, reinitialized in-line 1608 * new right page from page split, reinitialized in-line
1609 * root from root page split: entry insertion; 1609 * root from root page split: entry insertion;
1610 */ 1610 */
1611 if (tlck->type & (tlckNEW | tlckEXTEND)) { 1611 if (tlck->type & (tlckNEW | tlckEXTEND)) {
1612 /* log after-image of the new page for logredo(): 1612 /* log after-image of the new page for logredo():
@@ -1641,8 +1641,8 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1641 } 1641 }
1642 1642
1643 /* 1643 /*
1644 * entry insertion/deletion, 1644 * entry insertion/deletion,
1645 * sibling page link update (old right page before split); 1645 * sibling page link update (old right page before split);
1646 */ 1646 */
1647 if (tlck->type & (tlckENTRY | tlckRELINK)) { 1647 if (tlck->type & (tlckENTRY | tlckRELINK)) {
1648 /* log after-image for logredo(): */ 1648 /* log after-image for logredo(): */
@@ -1658,11 +1658,11 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1658 } 1658 }
1659 1659
1660 /* 1660 /*
1661 * page deletion: page has been invalidated 1661 * page deletion: page has been invalidated
1662 * page relocation: source extent 1662 * page relocation: source extent
1663 * 1663 *
1664 * a maplock for free of the page has been formatted 1664 * a maplock for free of the page has been formatted
1665 * at txLock() time); 1665 * at txLock() time);
1666 */ 1666 */
1667 if (tlck->type & (tlckFREE | tlckRELOCATE)) { 1667 if (tlck->type & (tlckFREE | tlckRELOCATE)) {
1668 /* log LOG_NOREDOPAGE of the deleted page for logredo() 1668 /* log LOG_NOREDOPAGE of the deleted page for logredo()
@@ -1683,9 +1683,9 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1683} 1683}
1684 1684
1685/* 1685/*
1686 * xtLog() 1686 * xtLog()
1687 * 1687 *
1688 * function: log xtree tlock and format maplock to update bmap; 1688 * function: log xtree tlock and format maplock to update bmap;
1689 */ 1689 */
1690static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 1690static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1691 struct tlock * tlck) 1691 struct tlock * tlck)
@@ -1725,8 +1725,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1725 xadlock = (struct xdlistlock *) maplock; 1725 xadlock = (struct xdlistlock *) maplock;
1726 1726
1727 /* 1727 /*
1728 * entry insertion/extension; 1728 * entry insertion/extension;
1729 * sibling page link update (old right page before split); 1729 * sibling page link update (old right page before split);
1730 */ 1730 */
1731 if (tlck->type & (tlckNEW | tlckGROW | tlckRELINK)) { 1731 if (tlck->type & (tlckNEW | tlckGROW | tlckRELINK)) {
1732 /* log after-image for logredo(): 1732 /* log after-image for logredo():
@@ -1801,7 +1801,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1801 } 1801 }
1802 1802
1803 /* 1803 /*
1804 * page deletion: file deletion/truncation (ref. xtTruncate()) 1804 * page deletion: file deletion/truncation (ref. xtTruncate())
1805 * 1805 *
1806 * (page will be invalidated after log is written and bmap 1806 * (page will be invalidated after log is written and bmap
1807 * is updated from the page); 1807 * is updated from the page);
@@ -1908,13 +1908,13 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1908 } 1908 }
1909 1909
1910 /* 1910 /*
1911 * page/entry truncation: file truncation (ref. xtTruncate()) 1911 * page/entry truncation: file truncation (ref. xtTruncate())
1912 * 1912 *
1913 * |----------+------+------+---------------| 1913 * |----------+------+------+---------------|
1914 * | | | 1914 * | | |
1915 * | | hwm - hwm before truncation 1915 * | | hwm - hwm before truncation
1916 * | next - truncation point 1916 * | next - truncation point
1917 * lwm - lwm before truncation 1917 * lwm - lwm before truncation
1918 * header ? 1918 * header ?
1919 */ 1919 */
1920 if (tlck->type & tlckTRUNCATE) { 1920 if (tlck->type & tlckTRUNCATE) {
@@ -1937,7 +1937,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1937 twm = xtlck->twm.offset; 1937 twm = xtlck->twm.offset;
1938 1938
1939 /* 1939 /*
1940 * write log records 1940 * write log records
1941 */ 1941 */
1942 /* log after-image for logredo(): 1942 /* log after-image for logredo():
1943 * 1943 *
@@ -1997,7 +1997,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1997 } 1997 }
1998 1998
1999 /* 1999 /*
2000 * format maplock(s) for txUpdateMap() to update bmap 2000 * format maplock(s) for txUpdateMap() to update bmap
2001 */ 2001 */
2002 maplock->index = 0; 2002 maplock->index = 0;
2003 2003
@@ -2069,9 +2069,9 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2069} 2069}
2070 2070
2071/* 2071/*
2072 * mapLog() 2072 * mapLog()
2073 * 2073 *
2074 * function: log from maplock of freed data extents; 2074 * function: log from maplock of freed data extents;
2075 */ 2075 */
2076static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, 2076static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2077 struct tlock * tlck) 2077 struct tlock * tlck)
@@ -2081,7 +2081,7 @@ static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2081 pxd_t *pxd; 2081 pxd_t *pxd;
2082 2082
2083 /* 2083 /*
2084 * page relocation: free the source page extent 2084 * page relocation: free the source page extent
2085 * 2085 *
2086 * a maplock for txUpdateMap() for free of the page 2086 * a maplock for txUpdateMap() for free of the page
2087 * has been formatted at txLock() time saving the src 2087 * has been formatted at txLock() time saving the src
@@ -2155,10 +2155,10 @@ static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2155} 2155}
2156 2156
2157/* 2157/*
2158 * txEA() 2158 * txEA()
2159 * 2159 *
2160 * function: acquire maplock for EA/ACL extents or 2160 * function: acquire maplock for EA/ACL extents or
2161 * set COMMIT_INLINE flag; 2161 * set COMMIT_INLINE flag;
2162 */ 2162 */
2163void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea) 2163void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea)
2164{ 2164{
@@ -2207,10 +2207,10 @@ void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea)
2207} 2207}
2208 2208
2209/* 2209/*
2210 * txForce() 2210 * txForce()
2211 * 2211 *
2212 * function: synchronously write pages locked by transaction 2212 * function: synchronously write pages locked by transaction
2213 * after txLog() but before txUpdateMap(); 2213 * after txLog() but before txUpdateMap();
2214 */ 2214 */
2215static void txForce(struct tblock * tblk) 2215static void txForce(struct tblock * tblk)
2216{ 2216{
@@ -2273,10 +2273,10 @@ static void txForce(struct tblock * tblk)
2273} 2273}
2274 2274
2275/* 2275/*
2276 * txUpdateMap() 2276 * txUpdateMap()
2277 * 2277 *
2278 * function: update persistent allocation map (and working map 2278 * function: update persistent allocation map (and working map
2279 * if appropriate); 2279 * if appropriate);
2280 * 2280 *
2281 * parameter: 2281 * parameter:
2282 */ 2282 */
@@ -2298,7 +2298,7 @@ static void txUpdateMap(struct tblock * tblk)
2298 2298
2299 2299
2300 /* 2300 /*
2301 * update block allocation map 2301 * update block allocation map
2302 * 2302 *
2303 * update allocation state in pmap (and wmap) and 2303 * update allocation state in pmap (and wmap) and
2304 * update lsn of the pmap page; 2304 * update lsn of the pmap page;
@@ -2382,7 +2382,7 @@ static void txUpdateMap(struct tblock * tblk)
2382 } 2382 }
2383 } 2383 }
2384 /* 2384 /*
2385 * update inode allocation map 2385 * update inode allocation map
2386 * 2386 *
2387 * update allocation state in pmap and 2387 * update allocation state in pmap and
2388 * update lsn of the pmap page; 2388 * update lsn of the pmap page;
@@ -2407,24 +2407,24 @@ static void txUpdateMap(struct tblock * tblk)
2407} 2407}
2408 2408
2409/* 2409/*
2410 * txAllocPMap() 2410 * txAllocPMap()
2411 * 2411 *
2412 * function: allocate from persistent map; 2412 * function: allocate from persistent map;
2413 * 2413 *
2414 * parameter: 2414 * parameter:
2415 * ipbmap - 2415 * ipbmap -
2416 * malock - 2416 * malock -
2417 * xad list: 2417 * xad list:
2418 * pxd: 2418 * pxd:
2419 * 2419 *
2420 * maptype - 2420 * maptype -
2421 * allocate from persistent map; 2421 * allocate from persistent map;
2422 * free from persistent map; 2422 * free from persistent map;
2423 * (e.g., tmp file - free from working map at releae 2423 * (e.g., tmp file - free from working map at releae
2424 * of last reference); 2424 * of last reference);
2425 * free from persistent and working map; 2425 * free from persistent and working map;
2426 * 2426 *
2427 * lsn - log sequence number; 2427 * lsn - log sequence number;
2428 */ 2428 */
2429static void txAllocPMap(struct inode *ip, struct maplock * maplock, 2429static void txAllocPMap(struct inode *ip, struct maplock * maplock,
2430 struct tblock * tblk) 2430 struct tblock * tblk)
@@ -2478,9 +2478,9 @@ static void txAllocPMap(struct inode *ip, struct maplock * maplock,
2478} 2478}
2479 2479
2480/* 2480/*
2481 * txFreeMap() 2481 * txFreeMap()
2482 * 2482 *
2483 * function: free from persistent and/or working map; 2483 * function: free from persistent and/or working map;
2484 * 2484 *
2485 * todo: optimization 2485 * todo: optimization
2486 */ 2486 */
@@ -2579,9 +2579,9 @@ void txFreeMap(struct inode *ip,
2579} 2579}
2580 2580
2581/* 2581/*
2582 * txFreelock() 2582 * txFreelock()
2583 * 2583 *
2584 * function: remove tlock from inode anonymous locklist 2584 * function: remove tlock from inode anonymous locklist
2585 */ 2585 */
2586void txFreelock(struct inode *ip) 2586void txFreelock(struct inode *ip)
2587{ 2587{
@@ -2619,7 +2619,7 @@ void txFreelock(struct inode *ip)
2619} 2619}
2620 2620
2621/* 2621/*
2622 * txAbort() 2622 * txAbort()
2623 * 2623 *
2624 * function: abort tx before commit; 2624 * function: abort tx before commit;
2625 * 2625 *
@@ -2679,7 +2679,7 @@ void txAbort(tid_t tid, int dirty)
2679} 2679}
2680 2680
2681/* 2681/*
2682 * txLazyCommit(void) 2682 * txLazyCommit(void)
2683 * 2683 *
2684 * All transactions except those changing ipimap (COMMIT_FORCE) are 2684 * All transactions except those changing ipimap (COMMIT_FORCE) are
2685 * processed by this routine. This insures that the inode and block 2685 * processed by this routine. This insures that the inode and block
@@ -2728,7 +2728,7 @@ static void txLazyCommit(struct tblock * tblk)
2728} 2728}
2729 2729
2730/* 2730/*
2731 * jfs_lazycommit(void) 2731 * jfs_lazycommit(void)
2732 * 2732 *
2733 * To be run as a kernel daemon. If lbmIODone is called in an interrupt 2733 * To be run as a kernel daemon. If lbmIODone is called in an interrupt
2734 * context, or where blocking is not wanted, this routine will process 2734 * context, or where blocking is not wanted, this routine will process
@@ -2913,7 +2913,7 @@ void txResume(struct super_block *sb)
2913} 2913}
2914 2914
2915/* 2915/*
2916 * jfs_sync(void) 2916 * jfs_sync(void)
2917 * 2917 *
2918 * To be run as a kernel daemon. This is awakened when tlocks run low. 2918 * To be run as a kernel daemon. This is awakened when tlocks run low.
2919 * We write any inodes that have anonymous tlocks so they will become 2919 * We write any inodes that have anonymous tlocks so they will become