Lines Matching refs:tblk

164 static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
166 static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
168 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
170 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
173 struct tblock * tblk);
174 static void txForce(struct tblock * tblk);
175 static int txLog(struct jfs_log * log, struct tblock * tblk,
177 static void txUpdateMap(struct tblock * tblk);
178 static void txRelease(struct tblock * tblk);
179 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
364 struct tblock *tblk; in txBegin() local
409 tblk = tid_to_tblock(t); in txBegin()
411 if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) { in txBegin()
419 TxAnchor.freetid = tblk->next; in txBegin()
431 tblk->next = tblk->last = tblk->xflag = tblk->flag = tblk->lsn = 0; in txBegin()
433 tblk->sb = sb; in txBegin()
435 tblk->logtid = log->logtid; in txBegin()
502 struct tblock *tblk = tid_to_tblock(tid); in txEnd() local
512 TXN_WAKEUP(&tblk->waitor); in txEnd()
514 log = JFS_SBI(tblk->sb)->log; in txEnd()
524 if (tblk->flag & tblkGC_LAZY) { in txEnd()
525 jfs_info("txEnd called w/lazy tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
529 tblk->flag |= tblkGC_UNLOCKED; in txEnd()
534 jfs_info("txEnd: tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
536 assert(tblk->next == 0); in txEnd()
541 tblk->next = TxAnchor.freetid; in txEnd()
601 struct tblock *tblk; in txLock() local
643 tblk = tid_to_tblock(tid); in txLock()
678 if (tblk->next) in txLock()
679 lid_to_tlock(tblk->last)->next = lid; in txLock()
681 tblk->next = lid; in txLock()
683 tblk->last = lid; in txLock()
745 tblk = tid_to_tblock(tid); in txLock()
746 if (tblk->next) in txLock()
747 lid_to_tlock(tblk->last)->next = lid; in txLock()
749 tblk->next = lid; in txLock()
751 tblk->last = lid; in txLock()
876 static void txRelease(struct tblock * tblk) in txRelease() argument
884 for (lid = tblk->next; lid; lid = tlck->next) { in txRelease()
897 TXN_WAKEUP(&tblk->waitor); in txRelease()
908 static void txUnlock(struct tblock * tblk) in txUnlock() argument
918 jfs_info("txUnlock: tblk = 0x%p", tblk); in txUnlock()
919 log = JFS_SBI(tblk->sb)->log; in txUnlock()
924 for (lid = tblk->next; lid; lid = next) { in txUnlock()
945 logdiff(difft, tblk->clsn, log); in txUnlock()
948 mp->clsn = tblk->clsn; in txUnlock()
950 mp->clsn = tblk->clsn; in txUnlock()
974 tblk->next = tblk->last = 0; in txUnlock()
981 if (tblk->lsn) { in txUnlock()
984 list_del(&tblk->synclist); in txUnlock()
999 struct tblock *tblk; in txMaplock() local
1030 tblk = tid_to_tblock(tid); in txMaplock()
1031 if (tblk->next) in txMaplock()
1032 lid_to_tlock(tblk->last)->next = lid; in txMaplock()
1034 tblk->next = lid; in txMaplock()
1036 tblk->last = lid; in txMaplock()
1143 struct tblock *tblk; in txCommit() local
1163 tblk = tid_to_tblock(tid); in txCommit()
1173 lrd->logtid = cpu_to_le32(tblk->logtid); in txCommit()
1176 tblk->xflag |= flag; in txCommit()
1179 tblk->xflag |= COMMIT_LAZY; in txCommit()
1249 lid_to_tlock(jfs_ip->atltail)->next = tblk->next; in txCommit()
1250 tblk->next = jfs_ip->atlhead; in txCommit()
1251 if (!tblk->last) in txCommit()
1252 tblk->last = jfs_ip->atltail; in txCommit()
1272 if ((rc = txLog(log, tblk, &cd))) in txCommit()
1279 if (tblk->xflag & COMMIT_DELETE) { in txCommit()
1280 ihold(tblk->u.ip); in txCommit()
1298 if (tblk->u.ip->i_state & I_SYNC) in txCommit()
1299 tblk->xflag &= ~COMMIT_LAZY; in txCommit()
1302 ASSERT((!(tblk->xflag & COMMIT_DELETE)) || in txCommit()
1303 ((tblk->u.ip->i_nlink == 0) && in txCommit()
1304 !test_cflag(COMMIT_Nolink, tblk->u.ip))); in txCommit()
1311 lmLog(log, tblk, lrd, NULL); in txCommit()
1313 lmGroupCommit(log, tblk); in txCommit()
1324 txForce(tblk); in txCommit()
1335 if (tblk->xflag & COMMIT_FORCE) in txCommit()
1336 txUpdateMap(tblk); in txCommit()
1341 txRelease(tblk); in txCommit()
1343 if ((tblk->flag & tblkGC_LAZY) == 0) in txCommit()
1344 txUnlock(tblk); in txCommit()
1381 static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd) in txLog() argument
1392 for (lid = tblk->next; lid; lid = tlck->next) { in txLog()
1406 xtLog(log, tblk, lrd, tlck); in txLog()
1410 dtLog(log, tblk, lrd, tlck); in txLog()
1414 diLog(log, tblk, lrd, tlck, cd); in txLog()
1418 mapLog(log, tblk, lrd, tlck); in txLog()
1422 dataLog(log, tblk, lrd, tlck); in txLog()
1438 static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in diLog() argument
1462 mp->logical_size >> tblk->sb->s_blocksize_bits); in diLog()
1463 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in diLog()
1500 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in diLog()
1535 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in diLog()
1551 static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in dataLog() argument
1582 PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); in dataLog()
1584 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dataLog()
1597 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in dtLog() argument
1633 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1634 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1662 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1663 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1685 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in dtLog()
1700 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in xtLog() argument
1752 mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1753 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1773 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1799 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1836 if (tblk->xflag & COMMIT_TRUNCATE) { in xtLog()
1841 mp->logical_size >> tblk->sb-> in xtLog()
1844 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
1850 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1868 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1876 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1902 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1910 if (((tblk->xflag & COMMIT_PWMAP) || S_ISDIR(ip->i_mode)) in xtLog()
1942 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1963 mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1964 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1983 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
2006 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
2086 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in mapLog() argument
2108 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2124 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2156 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2225 static void txForce(struct tblock * tblk) in txForce() argument
2236 tlck = lid_to_tlock(tblk->next); in txForce()
2242 tlck->next = tblk->next; in txForce()
2243 tblk->next = lid; in txForce()
2251 for (lid = tblk->next; lid; lid = next) { in txForce()
2293 static void txUpdateMap(struct tblock * tblk) in txUpdateMap() argument
2305 ipimap = JFS_SBI(tblk->sb)->ipimap; in txUpdateMap()
2307 maptype = (tblk->xflag & COMMIT_PMAP) ? COMMIT_PMAP : COMMIT_PWMAP; in txUpdateMap()
2322 for (lid = tblk->next; lid; lid = tlck->next) { in txUpdateMap()
2356 txAllocPMap(ipimap, maplock, tblk); in txUpdateMap()
2376 tblk, COMMIT_PWMAP); in txUpdateMap()
2379 tblk, maptype); in txUpdateMap()
2383 if (!(tblk->flag & tblkGC_LAZY)) { in txUpdateMap()
2403 if (tblk->xflag & COMMIT_CREATE) { in txUpdateMap()
2404 diUpdatePMap(ipimap, tblk->ino, false, tblk); in txUpdateMap()
2409 pxdlock.pxd = tblk->u.ixpxd; in txUpdateMap()
2411 txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk); in txUpdateMap()
2412 } else if (tblk->xflag & COMMIT_DELETE) { in txUpdateMap()
2413 ip = tblk->u.ip; in txUpdateMap()
2414 diUpdatePMap(ipimap, ip->i_ino, true, tblk); in txUpdateMap()
2440 struct tblock * tblk) in txAllocPMap() argument
2463 (s64) xlen, tblk); in txAllocPMap()
2473 dbUpdatePMap(ipbmap, false, xaddr, (s64) xlen, tblk); in txAllocPMap()
2483 tblk); in txAllocPMap()
2498 struct maplock * maplock, struct tblock * tblk, int maptype) in txFreeMap() argument
2511 tblk, maplock, maptype); in txFreeMap()
2525 (s64) xlen, tblk); in txFreeMap()
2536 tblk); in txFreeMap()
2547 (s64) xlen, tblk); in txFreeMap()
2646 struct tblock *tblk = tid_to_tblock(tid); in txAbort() local
2652 for (lid = tblk->next; lid; lid = next) { in txAbort()
2680 tblk->next = tblk->last = 0; in txAbort()
2686 jfs_error(tblk->sb, "\n"); in txAbort()
2699 static void txLazyCommit(struct tblock * tblk) in txLazyCommit() argument
2703 while (((tblk->flag & tblkGC_READY) == 0) && in txLazyCommit()
2704 ((tblk->flag & tblkGC_UNLOCKED) == 0)) { in txLazyCommit()
2707 jfs_info("jfs_lazycommit: tblk 0x%p not unlocked", tblk); in txLazyCommit()
2711 jfs_info("txLazyCommit: processing tblk 0x%p", tblk); in txLazyCommit()
2713 txUpdateMap(tblk); in txLazyCommit()
2715 log = (struct jfs_log *) JFS_SBI(tblk->sb)->log; in txLazyCommit()
2719 tblk->flag |= tblkGC_COMMITTED; in txLazyCommit()
2721 if (tblk->flag & tblkGC_READY) in txLazyCommit()
2724 wake_up_all(&tblk->gcwait); // LOGGC_WAKEUP in txLazyCommit()
2729 if (tblk->flag & tblkGC_LAZY) { in txLazyCommit()
2731 txUnlock(tblk); in txLazyCommit()
2732 tblk->flag &= ~tblkGC_LAZY; in txLazyCommit()
2733 txEnd(tblk - TxBlock); /* Convert back to tid */ in txLazyCommit()
2737 jfs_info("txLazyCommit: done: tblk = 0x%p", tblk); in txLazyCommit()
2750 struct tblock *tblk; in jfs_lazycommit() local
2759 list_for_each_entry(tblk, &TxAnchor.unlock_queue, in jfs_lazycommit()
2762 sbi = JFS_SBI(tblk->sb); in jfs_lazycommit()
2778 list_del(&tblk->cqueue); in jfs_lazycommit()
2781 txLazyCommit(tblk); in jfs_lazycommit()
2821 void txLazyUnlock(struct tblock * tblk) in txLazyUnlock() argument
2827 list_add_tail(&tblk->cqueue, &TxAnchor.unlock_queue); in txLazyUnlock()
2832 if (!(JFS_SBI(tblk->sb)->commit_state & IN_LAZYCOMMIT) && in txLazyUnlock()