MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / jbd2_journal_bmap

Function jbd2_journal_bmap

Ext4Fsd/jbd2/journal.c:812–833  ·  view source on GitHub ↗

* Conversion of logical to physical block numbers for the journal * * On external journals the journal blocks are identity-mapped, so * this is a no-op. If needed, we can use j_blk_offset - everything is * ready. */

Source from the content-addressed store, hash-verified

810 * ready.
811 */
812int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr,
813 unsigned long long *retp)
814{
815 int err = 0;
816 unsigned long long ret;
817
818 if (journal->j_inode) {
819 ret = bmap(journal->j_inode, blocknr);
820 if (ret)
821 *retp = ret;
822 else {
823 /*printk(KERN_ALERT "%s: journal block not found "
824 "at offset %lu on %s\n",
825 __func__, blocknr, journal->j_devname);*/
826 err = -EIO;
827 __journal_abort_soft(journal, err);
828 }
829 } else {
830 *retp = blocknr; /* +journal->j_blk_offset */
831 }
832 return err;
833}
834#if 0
835/*
836 * We play buffer_head aliasing tricks to write data/metadata blocks to

Callers 3

do_readaheadFunction · 0.85
jreadFunction · 0.85

Calls 2

bmapFunction · 0.85
__journal_abort_softFunction · 0.70

Tested by

no test coverage detected