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;
401 tblk = tid_to_tblock(t);
403 if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) {
404 /* Don't let a non-forced transaction take the last tblk */
411 TxAnchor.freetid = tblk->next;
419 * awakened after sleeping on tblk->waitor
421 * memset(tblk, 0, sizeof(struct tblock));
423 tblk->next = tblk->last = tblk->xflag = tblk->flag = tblk->lsn = 0;
425 tblk->sb = sb;
427 tblk->logtid = log->logtid;
494 struct tblock *tblk = tid_to_tblock(tid);
504 TXN_WAKEUP(&tblk->waitor);
506 log = JFS_SBI(tblk->sb)->log;
516 if (tblk->flag & tblkGC_LAZY) {
517 jfs_info("txEnd called w/lazy tid: %d, tblk = 0x%p", tid, tblk);
521 tblk->flag |= tblkGC_UNLOCKED;
526 jfs_info("txEnd: tid: %d, tblk = 0x%p", tid, tblk);
528 assert(tblk->next == 0);
533 tblk->next = TxAnchor.freetid;
593 struct tblock *tblk;
635 tblk = tid_to_tblock(tid);
670 if (tblk->next)
671 lid_to_tlock(tblk->last)->next = lid;
673 tblk->next = lid;
675 tblk->last = lid;
737 tblk = tid_to_tblock(tid);
738 if (tblk->next)
739 lid_to_tlock(tblk->last)->next = lid;
741 tblk->next = lid;
743 tblk->last = lid;
864 * tblk -
868 static void txRelease(struct tblock * tblk)
876 for (lid = tblk->next; lid; lid = tlck->next) {
889 TXN_WAKEUP(&tblk->waitor);
900 static void txUnlock(struct tblock * tblk)
910 jfs_info("txUnlock: tblk = 0x%p", tblk);
911 log = JFS_SBI(tblk->sb)->log;
916 for (lid = tblk->next; lid; lid = next) {
937 logdiff(difft, tblk->clsn, log);
940 mp->clsn = tblk->clsn;
942 mp->clsn = tblk->clsn;
966 tblk->next = tblk->last = 0;
970 * (allocation map pages inherited lsn of tblk and
973 if (tblk->lsn) {
976 list_del(&tblk->synclist);
991 struct tblock *tblk;
1022 tblk = tid_to_tblock(tid);
1023 if (tblk->next)
1024 lid_to_tlock(tblk->last)->next = lid;
1026 tblk->next = lid;
1028 tblk->last = lid;
1135 struct tblock *tblk;
1155 tblk = tid_to_tblock(tid);
1165 lrd->logtid = cpu_to_le32(tblk->logtid);
1168 tblk->xflag |= flag;
1171 tblk->xflag |= COMMIT_LAZY;
1228 * && (tblk->flag & COMMIT_DELETE) == 0)
1241 lid_to_tlock(jfs_ip->atltail)->next = tblk->next;
1242 tblk->next = jfs_ip->atlhead;
1243 if (!tblk->last)
1244 tblk->last = jfs_ip->atltail;
1253 * (become first tlock of the tblk's tlock list)
1264 txLog(log, tblk, &cd);
1270 if (tblk->xflag & COMMIT_DELETE) {
1271 ihold(tblk->u.ip);
1289 if (tblk->u.ip->i_state & I_SYNC)
1290 tblk->xflag &= ~COMMIT_LAZY;
1293 ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
1294 ((tblk->u.ip->i_nlink == 0) &&
1295 !test_cflag(COMMIT_Nolink, tblk->u.ip)));
1302 lmLog(log, tblk, lrd, NULL);
1304 lmGroupCommit(log, tblk);
1315 txForce(tblk);
1326 if (tblk->xflag & COMMIT_FORCE)
1327 txUpdateMap(tblk);
1332 txRelease(tblk);
1334 if ((tblk->flag & tblkGC_LAZY) == 0)
1335 txUnlock(tblk);
1372 static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
1382 for (lid = tblk->next; lid; lid = tlck->next) {
1396 xtLog(log, tblk, lrd, tlck);
1400 dtLog(log, tblk, lrd, tlck);
1404 diLog(log, tblk, lrd, tlck, cd);
1408 mapLog(log, tblk, lrd, tlck);
1412 dataLog(log, tblk, lrd, tlck);
1428 static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
1451 mp->logical_size >> tblk->sb->s_blocksize_bits);
1452 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1489 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1506 static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
1537 PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits);
1539 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1552 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1588 mp->logical_size >> tblk->sb->s_blocksize_bits);
1589 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1617 mp->logical_size >> tblk->sb->s_blocksize_bits);
1618 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1640 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1655 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1707 mp->logical_size >> tblk->sb->s_blocksize_bits);
1708 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1728 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) {
1754 tblk->xflag &= ~COMMIT_LAZY;
1791 if (tblk->xflag & COMMIT_TRUNCATE) {
1796 mp->logical_size >> tblk->sb->
1799 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1805 cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1823 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1831 if ((xadlock->count <= 4) && (tblk->xflag & COMMIT_LAZY)) {
1857 tblk->xflag &= ~COMMIT_LAZY;
1865 if (((tblk->xflag & COMMIT_PWMAP) || S_ISDIR(ip->i_mode))
1869 else (tblk->xflag & COMMIT_PMAP)
1896 tblk->xflag &= ~COMMIT_LAZY;
1917 mp->logical_size >> tblk->sb->s_blocksize_bits);
1918 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1937 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1960 cpu_to_le32(lmLog(log, tblk, lrd, tlck));
2038 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2060 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2076 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2108 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2177 static void txForce(struct tblock * tblk)
2188 tlck = lid_to_tlock(tblk->next);
2194 tlck->next = tblk->next;
2195 tblk->next = lid;
2203 for (lid = tblk->next; lid; lid = next) {
2245 static void txUpdateMap(struct tblock * tblk)
2257 ipimap = JFS_SBI(tblk->sb)->ipimap;
2259 maptype = (tblk->xflag & COMMIT_PMAP) ? COMMIT_PMAP : COMMIT_PWMAP;
2274 for (lid = tblk->next; lid; lid = tlck->next) {
2308 txAllocPMap(ipimap, maplock, tblk);
2328 tblk, COMMIT_PWMAP);
2331 tblk, maptype);
2335 if (!(tblk->flag & tblkGC_LAZY)) {
2355 if (tblk->xflag & COMMIT_CREATE) {
2356 diUpdatePMap(ipimap, tblk->ino, false, tblk);
2361 pxdlock.pxd = tblk->u.ixpxd;
2363 txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk);
2364 } else if (tblk->xflag & COMMIT_DELETE) {
2365 ip = tblk->u.ip;
2366 diUpdatePMap(ipimap, ip->i_ino, true, tblk);
2392 struct tblock * tblk)
2415 (s64) xlen, tblk);
2425 dbUpdatePMap(ipbmap, false, xaddr, (s64) xlen, tblk);
2435 tblk);
2450 struct maplock * maplock, struct tblock * tblk, int maptype)
2462 jfs_info("txFreeMap: tblk:0x%p maplock:0x%p maptype:0x%x",
2463 tblk, maplock, maptype);
2477 (s64) xlen, tblk);
2487 tblk);
2498 (s64) xlen, tblk);
2597 struct tblock *tblk = tid_to_tblock(tid);
2603 for (lid = tblk->next; lid; lid = next) {
2631 tblk->next = tblk->last = 0;
2637 jfs_error(tblk->sb, "\n");
2650 static void txLazyCommit(struct tblock * tblk)
2654 while (((tblk->flag & tblkGC_READY) == 0) &&
2655 ((tblk->flag & tblkGC_UNLOCKED) == 0)) {
2658 jfs_info("jfs_lazycommit: tblk 0x%p not unlocked", tblk);
2662 jfs_info("txLazyCommit: processing tblk 0x%p", tblk);
2664 txUpdateMap(tblk);
2666 log = (struct jfs_log *) JFS_SBI(tblk->sb)->log;
2670 tblk->flag |= tblkGC_COMMITTED;
2672 if (tblk->flag & tblkGC_READY)
2675 wake_up_all(&tblk->gcwait); // LOGGC_WAKEUP
2678 * Can't release log->gclock until we've tested tblk->flag
2680 if (tblk->flag & tblkGC_LAZY) {
2682 txUnlock(tblk);
2683 tblk->flag &= ~tblkGC_LAZY;
2684 txEnd(tblk - TxBlock); /* Convert back to tid */
2688 jfs_info("txLazyCommit: done: tblk = 0x%p", tblk);
2701 struct tblock *tblk;
2711 list_for_each_entry(tblk, &TxAnchor.unlock_queue,
2714 sbi = JFS_SBI(tblk->sb);
2718 * is handling a tblk for this superblock,
2730 list_del(&tblk->cqueue);
2733 txLazyCommit(tblk);
2773 void txLazyUnlock(struct tblock * tblk)
2779 list_add_tail(&tblk->cqueue, &TxAnchor.unlock_queue);
2784 if (!(JFS_SBI(tblk->sb)->commit_state & IN_LAZYCOMMIT) &&