Lines Matching refs:tblk
170 static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
172 static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
174 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
176 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
179 struct tblock * tblk);
180 static void txForce(struct tblock * tblk);
181 static int txLog(struct jfs_log * log, struct tblock * tblk,
183 static void txUpdateMap(struct tblock * tblk);
184 static void txRelease(struct tblock * tblk);
185 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
332 struct tblock *tblk; in txBegin() local
377 tblk = tid_to_tblock(t); in txBegin()
379 if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) { in txBegin()
387 TxAnchor.freetid = tblk->next; in txBegin()
399 tblk->next = tblk->last = tblk->xflag = tblk->flag = tblk->lsn = 0; in txBegin()
401 tblk->sb = sb; in txBegin()
403 tblk->logtid = log->logtid; in txBegin()
472 struct tblock *tblk = tid_to_tblock(tid); in txEnd() local
482 TXN_WAKEUP(&tblk->waitor); in txEnd()
484 log = JFS_SBI(tblk->sb)->log; in txEnd()
494 if (tblk->flag & tblkGC_LAZY) { in txEnd()
495 jfs_info("txEnd called w/lazy tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
499 tblk->flag |= tblkGC_UNLOCKED; in txEnd()
504 jfs_info("txEnd: tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
506 assert(tblk->next == 0); in txEnd()
511 tblk->next = TxAnchor.freetid; in txEnd()
568 struct tblock *tblk; in txLock() local
609 tblk = tid_to_tblock(tid); in txLock()
642 if (tblk->next) in txLock()
643 lid_to_tlock(tblk->last)->next = lid; in txLock()
645 tblk->next = lid; in txLock()
647 tblk->last = lid; in txLock()
705 tblk = tid_to_tblock(tid); in txLock()
706 if (tblk->next) in txLock()
707 lid_to_tlock(tblk->last)->next = lid; in txLock()
709 tblk->next = lid; in txLock()
711 tblk->last = lid; in txLock()
825 static void txRelease(struct tblock * tblk) in txRelease() argument
833 for (lid = tblk->next; lid; lid = tlck->next) { in txRelease()
846 TXN_WAKEUP(&tblk->waitor); in txRelease()
858 static void txUnlock(struct tblock * tblk) in txUnlock() argument
867 jfs_info("txUnlock: tblk = 0x%p", tblk); in txUnlock()
868 log = JFS_SBI(tblk->sb)->log; in txUnlock()
873 for (lid = tblk->next; lid; lid = next) { in txUnlock()
899 logdiff(difft, tblk->clsn, log); in txUnlock()
902 mp->clsn = tblk->clsn; in txUnlock()
904 mp->clsn = tblk->clsn; in txUnlock()
933 tblk->next = tblk->last = 0; in txUnlock()
940 if (tblk->lsn) { in txUnlock()
943 list_del(&tblk->synclist); in txUnlock()
959 struct tblock *tblk; in txMaplock() local
988 tblk = tid_to_tblock(tid); in txMaplock()
989 if (tblk->next) in txMaplock()
990 lid_to_tlock(tblk->last)->next = lid; in txMaplock()
992 tblk->next = lid; in txMaplock()
994 tblk->last = lid; in txMaplock()
1102 struct tblock *tblk; in txCommit() local
1123 tblk = tid_to_tblock(tid); in txCommit()
1133 lrd->logtid = cpu_to_le32(tblk->logtid); in txCommit()
1136 tblk->xflag |= flag; in txCommit()
1139 tblk->xflag |= COMMIT_LAZY; in txCommit()
1178 ((tblk->flag & COMMIT_DELETE) == 0)) in txCommit()
1190 lid_to_tlock(jfs_ip->atltail)->next = tblk->next; in txCommit()
1191 tblk->next = jfs_ip->atlhead; in txCommit()
1192 if (!tblk->last) in txCommit()
1193 tblk->last = jfs_ip->atltail; in txCommit()
1213 if ((rc = txLog(log, tblk, &cd))) in txCommit()
1220 if (tblk->xflag & (COMMIT_CREATE | COMMIT_DELETE)) { in txCommit()
1221 atomic_inc(&tblk->ip->i_count); in txCommit()
1232 if (tblk->ip->i_state & I_LOCK) in txCommit()
1233 tblk->xflag &= ~COMMIT_LAZY; in txCommit()
1236 ASSERT((!(tblk->xflag & COMMIT_DELETE)) || in txCommit()
1237 ((tblk->ip->i_nlink == 0) && in txCommit()
1238 !test_cflag(COMMIT_Nolink, tblk->ip))); in txCommit()
1245 lsn = lmLog(log, tblk, lrd, NULL); in txCommit()
1247 lmGroupCommit(log, tblk); in txCommit()
1258 txForce(tblk); in txCommit()
1269 if (tblk->xflag & COMMIT_FORCE) in txCommit()
1270 txUpdateMap(tblk); in txCommit()
1275 txRelease(tblk); in txCommit()
1277 if ((tblk->flag & tblkGC_LAZY) == 0) in txCommit()
1278 txUnlock(tblk); in txCommit()
1316 static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd) in txLog() argument
1327 for (lid = tblk->next; lid; lid = tlck->next) { in txLog()
1341 xtLog(log, tblk, lrd, tlck); in txLog()
1345 dtLog(log, tblk, lrd, tlck); in txLog()
1349 diLog(log, tblk, lrd, tlck, cd); in txLog()
1353 mapLog(log, tblk, lrd, tlck); in txLog()
1357 dataLog(log, tblk, lrd, tlck); in txLog()
1374 static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in diLog() argument
1399 mp->logical_size >> tblk->sb->s_blocksize_bits); in diLog()
1400 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in diLog()
1437 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in diLog()
1472 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in diLog()
1489 static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in dataLog() argument
1520 PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); in dataLog()
1522 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dataLog()
1536 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in dtLog() argument
1573 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1574 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1602 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1603 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1625 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in dtLog()
1641 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in xtLog() argument
1694 mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1695 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1715 if ((xadlock->count <= 2) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1735 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1772 if (tblk->xflag & COMMIT_TRUNCATE) { in xtLog()
1777 mp->logical_size >> tblk->sb-> in xtLog()
1780 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
1786 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1804 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1813 if ((xadlock->count <= 2) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1828 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1836 if (((tblk->xflag & COMMIT_PWMAP) || S_ISDIR(ip->i_mode)) in xtLog()
1867 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1887 PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1888 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1907 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
1930 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
2013 void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in mapLog() argument
2035 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2051 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2083 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2154 void txForce(struct tblock * tblk) in txForce() argument
2165 tlck = lid_to_tlock(tblk->next); in txForce()
2171 tlck->next = tblk->next; in txForce()
2172 tblk->next = lid; in txForce()
2180 for (lid = tblk->next; lid; lid = next) { in txForce()
2221 static void txUpdateMap(struct tblock * tblk) in txUpdateMap() argument
2233 ipimap = JFS_SBI(tblk->sb)->ipimap; in txUpdateMap()
2235 maptype = (tblk->xflag & COMMIT_PMAP) ? COMMIT_PMAP : COMMIT_PWMAP; in txUpdateMap()
2250 for (lid = tblk->next; lid; lid = tlck->next) { in txUpdateMap()
2284 txAllocPMap(ipimap, maplock, tblk); in txUpdateMap()
2304 tblk, COMMIT_PWMAP); in txUpdateMap()
2307 tblk, maptype); in txUpdateMap()
2311 if (!(tblk->flag & tblkGC_LAZY)) { in txUpdateMap()
2331 if (tblk->xflag & COMMIT_CREATE) { in txUpdateMap()
2332 ip = tblk->ip; in txUpdateMap()
2337 diUpdatePMap(ipimap, ip->i_ino, FALSE, tblk); in txUpdateMap()
2345 txAllocPMap(ip, (struct maplock *) & pxdlock, tblk); in txUpdateMap()
2347 } else if (tblk->xflag & COMMIT_DELETE) { in txUpdateMap()
2348 ip = tblk->ip; in txUpdateMap()
2349 diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk); in txUpdateMap()
2377 struct tblock * tblk) in txAllocPMap() argument
2400 (s64) xlen, tblk); in txAllocPMap()
2410 dbUpdatePMap(ipbmap, FALSE, xaddr, (s64) xlen, tblk); in txAllocPMap()
2420 tblk); in txAllocPMap()
2436 struct maplock * maplock, struct tblock * tblk, int maptype) in txFreeMap() argument
2449 tblk, maplock, maptype); in txFreeMap()
2463 (s64) xlen, tblk); in txFreeMap()
2474 tblk); in txFreeMap()
2485 (s64) xlen, tblk); in txFreeMap()
2586 struct tblock *tblk = tid_to_tblock(tid); in txAbort() local
2594 for (lid = tblk->next; lid; lid = next) { in txAbort()
2622 tblk->next = tblk->last = 0; in txAbort()
2628 jfs_error(tblk->sb, "txAbort"); in txAbort()
2641 static void txLazyCommit(struct tblock * tblk) in txLazyCommit() argument
2645 while (((tblk->flag & tblkGC_READY) == 0) && in txLazyCommit()
2646 ((tblk->flag & tblkGC_UNLOCKED) == 0)) { in txLazyCommit()
2649 jfs_info("txLazyCommit: tblk 0x%p not unlocked", tblk); in txLazyCommit()
2653 jfs_info("txLazyCommit: processing tblk 0x%p", tblk); in txLazyCommit()
2655 txUpdateMap(tblk); in txLazyCommit()
2657 log = (struct jfs_log *) JFS_SBI(tblk->sb)->log; in txLazyCommit()
2661 tblk->flag |= tblkGC_COMMITTED; in txLazyCommit()
2663 if (tblk->flag & tblkGC_READY) in txLazyCommit()
2666 wake_up_all(&tblk->gcwait); // LOGGC_WAKEUP in txLazyCommit()
2671 if (tblk->flag & tblkGC_LAZY) { in txLazyCommit()
2673 txUnlock(tblk); in txLazyCommit()
2674 tblk->flag &= ~tblkGC_LAZY; in txLazyCommit()
2675 txEnd(tblk - TxBlock); /* Convert back to tid */ in txLazyCommit()
2679 jfs_info("txLazyCommit: done: tblk = 0x%p", tblk); in txLazyCommit()
2692 struct tblock *tblk; in jfs_lazycommit() local
2721 while ((tblk = TxAnchor.unlock_queue)) { in jfs_lazycommit()
2733 TxAnchor.unlock_queue = tblk->cqnext; in jfs_lazycommit()
2734 tblk->cqnext = 0; in jfs_lazycommit()
2735 if (TxAnchor.unlock_tail == tblk) in jfs_lazycommit()
2739 txLazyCommit(tblk); in jfs_lazycommit()
2767 void txLazyUnlock(struct tblock * tblk) in txLazyUnlock() argument
2774 TxAnchor.unlock_tail->cqnext = tblk; in txLazyUnlock()
2776 TxAnchor.unlock_queue = tblk; in txLazyUnlock()
2777 TxAnchor.unlock_tail = tblk; in txLazyUnlock()
2778 tblk->cqnext = 0; in txLazyUnlock()