* 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. */
| 810 | * ready. |
| 811 | */ |
| 812 | int 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 |
no test coverage detected