Lines Matching refs:log

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,
162 static void txLog(struct jfs_log *log, struct tblock *tblk,
166 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
352 struct jfs_log *log;
355 log = JFS_SBI(sb)->log;
357 if (!log) {
371 if (test_bit(log_SYNCBARRIER, &log->flag) ||
372 test_bit(log_QUIESCE, &log->flag)) {
374 TXN_SLEEP(&log->syncwait);
426 ++log->logtid;
427 tblk->logtid = log->logtid;
429 ++log->active;
454 struct jfs_log *log;
456 log = JFS_SBI(sb)->log;
465 if (test_bit(log_SYNCBARRIER, &log->flag) ||
466 test_bit(log_QUIESCE, &log->flag)) {
468 TXN_SLEEP(&log->syncwait);
495 struct jfs_log *log;
506 log = JFS_SBI(tblk->sb)->log;
520 spin_lock_irq(&log->gclock); // LOGGC_LOCK
522 spin_unlock_irq(&log->gclock); // LOGGC_UNLOCK
539 if (--log->active == 0) {
540 clear_bit(log_FLUSH, &log->flag);
545 if (test_bit(log_SYNCBARRIER, &log->flag)) {
548 /* write dirty metadata & forward log syncpt */
549 jfs_syncpt(log, 1);
551 jfs_info("log barrier off: 0x%x", log->lsn);
554 clear_bit(log_SYNCBARRIER, &log->flag);
557 TXN_WAKEUP(&log->syncwait);
906 struct jfs_log *log;
911 log = JFS_SBI(tblk->sb)->log;
914 * mark page under tlock homeok (its log has been written):
935 LOGSYNC_LOCK(log, flags);
937 logdiff(difft, tblk->clsn, log);
938 logdiff(diffp, mp->clsn, log);
943 LOGSYNC_UNLOCK(log, flags);
974 LOGSYNC_LOCK(log, flags);
975 log->count--;
977 LOGSYNC_UNLOCK(log, flags);
1058 * function: allocate a transaction lock for log vector list
1134 struct jfs_log *log;
1160 log = JFS_SBI(sb)->log;
1161 cd.log = log;
1163 /* initialize log record descriptor in commit */
1260 * write log records from transaction locks
1264 txLog(log, tblk, &cd);
1298 * write COMMIT log record
1302 lmLog(log, tblk, lrd, NULL);
1304 lmGroupCommit(log, tblk);
1364 * FUNCTION: Writes AFTER log records for all lines modified
1372 static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
1380 * write log record(s) for each tlock of transaction,
1390 lrd->log.redopage.fileset = cpu_to_le32(JFS_IP(ip)->fileset);
1391 lrd->log.redopage.inode = cpu_to_le32(ip->i_ino);
1393 /* write log record of page from the tlock */
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);
1426 * function: log inode tlock and format maplock to update bmap;
1428 static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
1438 lrd->log.redopage.type = cpu_to_le16(LOG_INODE);
1439 lrd->log.redopage.l2linesize = cpu_to_le16(L2INODESLOTSIZE);
1441 pxd = &lrd->log.redopage.pxd;
1447 /* log after-image for logredo(): */
1452 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1467 * page before the log;
1470 /* log LOG_NOREDOINOEXT of the freed inode extent for
1482 lrd->log.noredoinoext.iagnum =
1484 lrd->log.noredoinoext.inoext_idx =
1489 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1504 * function: log data tlock
1506 static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
1515 lrd->log.redopage.type = cpu_to_le16(LOG_DATA);
1516 lrd->log.redopage.l2linesize = cpu_to_le16(L2DATASLOTSIZE);
1518 pxd = &lrd->log.redopage.pxd;
1520 /* log after-image for logredo(): */
1539 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1550 * function: log dtree tlock and format maplock to update bmap;
1552 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1562 lrd->log.redopage.type = cpu_to_le16(LOG_DTREE);
1563 lrd->log.redopage.l2linesize = cpu_to_le16(L2DTSLOTSIZE);
1565 pxd = &lrd->log.redopage.pxd;
1568 lrd->log.redopage.type |= cpu_to_le16(LOG_BTROOT);
1577 /* log after-image of the new page for logredo():
1578 * mark log (LOG_NEW) for logredo() to initialize
1583 lrd->log.redopage.type |= cpu_to_le16(LOG_EXTEND);
1585 lrd->log.redopage.type |= cpu_to_le16(LOG_NEW);
1589 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1613 /* log after-image for logredo(): */
1618 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1633 /* log LOG_NOREDOPAGE of the deleted page for logredo()
1640 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1653 * function: log xtree tlock and format maplock to update bmap;
1655 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1672 lrd->log.redopage.type = cpu_to_le16(LOG_XTREE);
1673 lrd->log.redopage.l2linesize = cpu_to_le16(L2XTSLOTSIZE);
1675 page_pxd = &lrd->log.redopage.pxd;
1678 lrd->log.redopage.type |= cpu_to_le16(LOG_BTROOT);
1681 lrd->log.redopage.type |=
1697 /* log after-image for logredo():
1708 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1771 * (page will be invalidated after log is written and bmap
1775 /* LOG_NOREDOPAGE log for NoRedoPage filter:
1784 * log for the page itself is generated from processing
1787 /* if page free from file truncation, log LOG_NOREDOPAGE
1799 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1805 cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1814 lrd->log.updatemap.type = cpu_to_le16(LOG_FREEXADLIST);
1817 lrd->log.updatemap.nxd =
1823 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1904 * write log records
1906 /* log after-image for logredo():
1918 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
1932 lrd->log.updatemap.type = cpu_to_le16(LOG_FREEPXD);
1933 lrd->log.updatemap.nxd = cpu_to_le16(1);
1934 lrd->log.updatemap.pxd = pxdlock->pxd;
1937 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
1949 lrd->log.updatemap.type =
1953 lrd->log.updatemap.nxd =
1960 cpu_to_le32(lmLog(log, tblk, lrd, tlck));
2036 * function: log from maplock of freed data extents;
2038 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
2053 /* log LOG_NOREDOPAGE of the old relocated page
2058 pxd = &lrd->log.redopage.pxd;
2060 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2064 * if page free from relocation, LOG_UPDATEMAP log is
2070 * avoiding an extra log write);
2073 lrd->log.updatemap.type = cpu_to_le16(LOG_FREEPXD);
2074 lrd->log.updatemap.nxd = cpu_to_le16(1);
2075 lrd->log.updatemap.pxd = pxdlock->pxd;
2076 lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2090 /* log LOG_UPDATEMAP for logredo() to update bmap for
2100 lrd->log.updatemap.type =
2103 lrd->log.updatemap.type =
2105 lrd->log.updatemap.nxd = cpu_to_le16(1);
2106 lrd->log.updatemap.pxd = pxdlock->pxd;
2108 cpu_to_le32(lmLog(log, tblk, lrd, NULL));
2389 * lsn - log sequence number;
2590 * log age of page-frames in memory for which caller has
2652 struct jfs_log *log;
2666 log = (struct jfs_log *) JFS_SBI(tblk->sb)->log;
2668 spin_lock_irq(&log->gclock); // LOGGC_LOCK
2673 log->gcrtc--;
2678 * Can't release log->gclock until we've tested tblk->flag
2681 spin_unlock_irq(&log->gclock); // LOGGC_UNLOCK
2686 spin_unlock_irq(&log->gclock); // LOGGC_UNLOCK
2794 struct jfs_log *log = mp->log;
2797 assert(log);
2815 struct jfs_log *log = JFS_SBI(sb)->log;
2818 set_bit(log_QUIESCE, &log->flag);
2859 jfs_flush_journal(log, 0);
2869 struct jfs_log *log = JFS_SBI(sb)->log;
2871 clear_bit(log_QUIESCE, &log->flag);
2872 TXN_WAKEUP(&log->syncwait);