Lines Matching refs:dn
466 block_t blkaddr, struct dnode_of_data *dn) in check_index_in_prev_nodes() argument
474 struct dnode_of_data tdn = *dn; in check_index_in_prev_nodes()
506 max_addrs = ADDRS_PER_PAGE(dn->node_page, dn->inode); in check_index_in_prev_nodes()
509 ofs_in_node, dn->inode->i_ino, nid, max_addrs); in check_index_in_prev_nodes()
514 if (dn->inode->i_ino == nid) { in check_index_in_prev_nodes()
516 if (!dn->inode_page_locked) in check_index_in_prev_nodes()
517 lock_page(dn->inode_page); in check_index_in_prev_nodes()
518 tdn.node_page = dn->inode_page; in check_index_in_prev_nodes()
521 } else if (dn->nid == nid) { in check_index_in_prev_nodes()
535 if (ino != dn->inode->i_ino) { in check_index_in_prev_nodes()
549 inode = dn->inode; in check_index_in_prev_nodes()
559 if (ino == dn->inode->i_ino && dn->inode_page_locked) in check_index_in_prev_nodes()
560 unlock_page(dn->inode_page); in check_index_in_prev_nodes()
571 if (ino != dn->inode->i_ino) in check_index_in_prev_nodes()
573 else if (dn->inode_page_locked) in check_index_in_prev_nodes()
574 lock_page(dn->inode_page); in check_index_in_prev_nodes()
580 if (dn->inode->i_ino == nid && !dn->inode_page_locked) in check_index_in_prev_nodes()
581 unlock_page(dn->inode_page); in check_index_in_prev_nodes()
588 struct dnode_of_data dn; in do_recover_data() local
617 set_new_dnode(&dn, inode, NULL, NULL, 0); in do_recover_data()
619 err = f2fs_get_dnode_of_data(&dn, start, ALLOC_NODE); in do_recover_data()
628 f2fs_wait_on_page_writeback(dn.node_page, NODE, true, true); in do_recover_data()
630 err = f2fs_get_node_info(sbi, dn.nid, &ni, false); in do_recover_data()
636 if (ofs_of_node(dn.node_page) != ofs_of_node(page)) { in do_recover_data()
638 inode->i_ino, ofs_of_node(dn.node_page), in do_recover_data()
645 for (; start < end; start++, dn.ofs_in_node++) { in do_recover_data()
648 src = f2fs_data_blkaddr(&dn); in do_recover_data()
649 dest = data_blkaddr(dn.inode, page, dn.ofs_in_node); in do_recover_data()
671 f2fs_truncate_data_blocks_range(&dn, 1); in do_recover_data()
685 f2fs_truncate_data_blocks_range(&dn, 1); in do_recover_data()
686 f2fs_reserve_new_block(&dn); in do_recover_data()
694 err = f2fs_reserve_new_block(&dn); in do_recover_data()
697 err = f2fs_reserve_new_block(&dn); in do_recover_data()
705 err = check_index_in_prev_nodes(sbi, dest, &dn); in do_recover_data()
717 dest, inode->i_ino, dn.ofs_in_node); in do_recover_data()
725 f2fs_replace_block(sbi, &dn, src, dest, in do_recover_data()
731 copy_node_footer(dn.node_page, page); in do_recover_data()
732 fill_node_footer(dn.node_page, dn.nid, ni.ino, in do_recover_data()
734 set_page_dirty(dn.node_page); in do_recover_data()
736 f2fs_put_dnode(&dn); in do_recover_data()