Lines Matching refs:tblk
151 static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
153 static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
155 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
157 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
160 struct tblock * tblk);
161 static void txForce(struct tblock * tblk);
162 static void txLog(struct jfs_log *log, struct tblock *tblk,
164 static void txUpdateMap(struct tblock * tblk);
165 static void txRelease(struct tblock * tblk);
166 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
351 struct tblock *tblk; in txBegin() local
396 tblk = tid_to_tblock(t); in txBegin()
398 if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) { in txBegin()
406 TxAnchor.freetid = tblk->next; in txBegin()
418 tblk->next = tblk->last = tblk->xflag = tblk->flag = tblk->lsn = 0; in txBegin()
420 tblk->sb = sb; in txBegin()
422 tblk->logtid = log->logtid; in txBegin()
489 struct tblock *tblk = tid_to_tblock(tid); in txEnd() local
499 TXN_WAKEUP(&tblk->waitor); in txEnd()
501 log = JFS_SBI(tblk->sb)->log; in txEnd()
511 if (tblk->flag & tblkGC_LAZY) { in txEnd()
512 jfs_info("txEnd called w/lazy tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
516 tblk->flag |= tblkGC_UNLOCKED; in txEnd()
521 jfs_info("txEnd: tid: %d, tblk = 0x%p", tid, tblk); in txEnd()
523 assert(tblk->next == 0); in txEnd()
528 tblk->next = TxAnchor.freetid; in txEnd()
588 struct tblock *tblk; in txLock() local
630 tblk = tid_to_tblock(tid); in txLock()
665 if (tblk->next) in txLock()
666 lid_to_tlock(tblk->last)->next = lid; in txLock()
668 tblk->next = lid; in txLock()
670 tblk->last = lid; in txLock()
732 tblk = tid_to_tblock(tid); in txLock()
733 if (tblk->next) in txLock()
734 lid_to_tlock(tblk->last)->next = lid; in txLock()
736 tblk->next = lid; in txLock()
738 tblk->last = lid; in txLock()
863 static void txRelease(struct tblock * tblk) in txRelease() argument
871 for (lid = tblk->next; lid; lid = tlck->next) { in txRelease()
884 TXN_WAKEUP(&tblk->waitor); in txRelease()
895 static void txUnlock(struct tblock * tblk) in txUnlock() argument
905 jfs_info("txUnlock: tblk = 0x%p", tblk); in txUnlock()
906 log = JFS_SBI(tblk->sb)->log; in txUnlock()
911 for (lid = tblk->next; lid; lid = next) { in txUnlock()
932 logdiff(difft, tblk->clsn, log); in txUnlock()
935 mp->clsn = tblk->clsn; in txUnlock()
937 mp->clsn = tblk->clsn; in txUnlock()
961 tblk->next = tblk->last = 0; in txUnlock()
968 if (tblk->lsn) { in txUnlock()
971 list_del(&tblk->synclist); in txUnlock()
986 struct tblock *tblk; in txMaplock() local
1017 tblk = tid_to_tblock(tid); in txMaplock()
1018 if (tblk->next) in txMaplock()
1019 lid_to_tlock(tblk->last)->next = lid; in txMaplock()
1021 tblk->next = lid; in txMaplock()
1023 tblk->last = lid; in txMaplock()
1130 struct tblock *tblk; in txCommit() local
1150 tblk = tid_to_tblock(tid); in txCommit()
1160 lrd->logtid = cpu_to_le32(tblk->logtid); in txCommit()
1163 tblk->xflag |= flag; in txCommit()
1166 tblk->xflag |= COMMIT_LAZY; in txCommit()
1236 lid_to_tlock(jfs_ip->atltail)->next = tblk->next; in txCommit()
1237 tblk->next = jfs_ip->atlhead; in txCommit()
1238 if (!tblk->last) in txCommit()
1239 tblk->last = jfs_ip->atltail; in txCommit()
1259 txLog(log, tblk, &cd); in txCommit()
1265 if (tblk->xflag & COMMIT_DELETE) { in txCommit()
1266 ihold(tblk->u.ip); in txCommit()
1284 if (tblk->u.ip->i_state & I_SYNC) in txCommit()
1285 tblk->xflag &= ~COMMIT_LAZY; in txCommit()
1288 ASSERT((!(tblk->xflag & COMMIT_DELETE)) || in txCommit()
1289 ((tblk->u.ip->i_nlink == 0) && in txCommit()
1290 !test_cflag(COMMIT_Nolink, tblk->u.ip))); in txCommit()
1297 lmLog(log, tblk, lrd, NULL); in txCommit()
1299 lmGroupCommit(log, tblk); in txCommit()
1310 txForce(tblk); in txCommit()
1321 if (tblk->xflag & COMMIT_FORCE) in txCommit()
1322 txUpdateMap(tblk); in txCommit()
1327 txRelease(tblk); in txCommit()
1329 if ((tblk->flag & tblkGC_LAZY) == 0) in txCommit()
1330 txUnlock(tblk); in txCommit()
1367 static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd) in txLog() argument
1377 for (lid = tblk->next; lid; lid = tlck->next) { in txLog()
1391 xtLog(log, tblk, lrd, tlck); in txLog()
1395 dtLog(log, tblk, lrd, tlck); in txLog()
1399 diLog(log, tblk, lrd, tlck, cd); in txLog()
1403 mapLog(log, tblk, lrd, tlck); in txLog()
1407 dataLog(log, tblk, lrd, tlck); in txLog()
1423 static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd, in diLog() argument
1446 mp->logical_size >> tblk->sb->s_blocksize_bits); in diLog()
1447 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in diLog()
1484 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in diLog()
1501 static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd, in dataLog() argument
1532 PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); in dataLog()
1534 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dataLog()
1547 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in dtLog() argument
1583 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1584 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1612 mp->logical_size >> tblk->sb->s_blocksize_bits); in dtLog()
1613 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in dtLog()
1635 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in dtLog()
1650 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in xtLog() argument
1702 mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1703 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1723 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1749 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1786 if (tblk->xflag & COMMIT_TRUNCATE) { in xtLog()
1791 mp->logical_size >> tblk->sb-> in xtLog()
1794 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
1800 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1818 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1826 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) { in xtLog()
1852 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1860 if (((tblk->xflag & COMMIT_PWMAP) || S_ISDIR(ip->i_mode)) in xtLog()
1891 tblk->xflag &= ~COMMIT_LAZY; in xtLog()
1912 mp->logical_size >> tblk->sb->s_blocksize_bits); in xtLog()
1913 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
1932 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in xtLog()
1955 cpu_to_le32(lmLog(log, tblk, lrd, tlck)); in xtLog()
2033 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, in mapLog() argument
2055 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2071 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2103 cpu_to_le32(lmLog(log, tblk, lrd, NULL)); in mapLog()
2172 static void txForce(struct tblock * tblk) in txForce() argument
2183 tlck = lid_to_tlock(tblk->next); in txForce()
2189 tlck->next = tblk->next; in txForce()
2190 tblk->next = lid; in txForce()
2198 for (lid = tblk->next; lid; lid = next) { in txForce()
2240 static void txUpdateMap(struct tblock * tblk) in txUpdateMap() argument
2252 ipimap = JFS_SBI(tblk->sb)->ipimap; in txUpdateMap()
2254 maptype = (tblk->xflag & COMMIT_PMAP) ? COMMIT_PMAP : COMMIT_PWMAP; in txUpdateMap()
2269 for (lid = tblk->next; lid; lid = tlck->next) { in txUpdateMap()
2303 txAllocPMap(ipimap, maplock, tblk); in txUpdateMap()
2323 tblk, COMMIT_PWMAP); in txUpdateMap()
2326 tblk, maptype); in txUpdateMap()
2330 if (!(tblk->flag & tblkGC_LAZY)) { in txUpdateMap()
2350 if (tblk->xflag & COMMIT_CREATE) { in txUpdateMap()
2351 diUpdatePMap(ipimap, tblk->ino, false, tblk); in txUpdateMap()
2356 pxdlock.pxd = tblk->u.ixpxd; in txUpdateMap()
2358 txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk); in txUpdateMap()
2359 } else if (tblk->xflag & COMMIT_DELETE) { in txUpdateMap()
2360 ip = tblk->u.ip; in txUpdateMap()
2361 diUpdatePMap(ipimap, ip->i_ino, true, tblk); in txUpdateMap()
2387 struct tblock * tblk) in txAllocPMap() argument
2410 (s64) xlen, tblk); in txAllocPMap()
2420 dbUpdatePMap(ipbmap, false, xaddr, (s64) xlen, tblk); in txAllocPMap()
2430 tblk); in txAllocPMap()
2445 struct maplock * maplock, struct tblock * tblk, int maptype) in txFreeMap() argument
2458 tblk, maplock, maptype); in txFreeMap()
2472 (s64) xlen, tblk); in txFreeMap()
2482 tblk); in txFreeMap()
2493 (s64) xlen, tblk); in txFreeMap()
2592 struct tblock *tblk = tid_to_tblock(tid); in txAbort() local
2598 for (lid = tblk->next; lid; lid = next) { in txAbort()
2626 tblk->next = tblk->last = 0; in txAbort()
2632 jfs_error(tblk->sb, "\n"); in txAbort()
2645 static void txLazyCommit(struct tblock * tblk) in txLazyCommit() argument
2649 while (((tblk->flag & tblkGC_READY) == 0) && in txLazyCommit()
2650 ((tblk->flag & tblkGC_UNLOCKED) == 0)) { in txLazyCommit()
2653 jfs_info("jfs_lazycommit: tblk 0x%p not unlocked", tblk); in txLazyCommit()
2657 jfs_info("txLazyCommit: processing tblk 0x%p", tblk); in txLazyCommit()
2659 txUpdateMap(tblk); in txLazyCommit()
2661 log = (struct jfs_log *) JFS_SBI(tblk->sb)->log; in txLazyCommit()
2665 tblk->flag |= tblkGC_COMMITTED; in txLazyCommit()
2667 if (tblk->flag & tblkGC_READY) in txLazyCommit()
2670 wake_up_all(&tblk->gcwait); // LOGGC_WAKEUP in txLazyCommit()
2675 if (tblk->flag & tblkGC_LAZY) { in txLazyCommit()
2677 txUnlock(tblk); in txLazyCommit()
2678 tblk->flag &= ~tblkGC_LAZY; in txLazyCommit()
2679 txEnd(tblk - TxBlock); /* Convert back to tid */ in txLazyCommit()
2683 jfs_info("txLazyCommit: done: tblk = 0x%p", tblk); in txLazyCommit()
2696 struct tblock *tblk; in jfs_lazycommit() local
2705 list_for_each_entry(tblk, &TxAnchor.unlock_queue, in jfs_lazycommit()
2708 sbi = JFS_SBI(tblk->sb); in jfs_lazycommit()
2724 list_del(&tblk->cqueue); in jfs_lazycommit()
2727 txLazyCommit(tblk); in jfs_lazycommit()
2767 void txLazyUnlock(struct tblock * tblk) in txLazyUnlock() argument
2773 list_add_tail(&tblk->cqueue, &TxAnchor.unlock_queue); in txLazyUnlock()
2778 if (!(JFS_SBI(tblk->sb)->commit_state & IN_LAZYCOMMIT) && in txLazyUnlock()