Lines Matching refs:rii
219 struct jffs2_readinode_info *rii, in jffs2_add_tn_to_tree() argument
232 if (rii->mdata_tn) { in jffs2_add_tn_to_tree()
233 if (rii->mdata_tn->version < tn->version) { in jffs2_add_tn_to_tree()
235 dbg_readinode("kill old mdata with ver %d\n", rii->mdata_tn->version); in jffs2_add_tn_to_tree()
236 jffs2_kill_tn(c, rii->mdata_tn); in jffs2_add_tn_to_tree()
239 tn->version, rii->mdata_tn->version); in jffs2_add_tn_to_tree()
244 rii->mdata_tn = tn; in jffs2_add_tn_to_tree()
250 this = jffs2_lookup_tn(&rii->tn_root, tn->fn->ofs); in jffs2_add_tn_to_tree()
286 rb_replace_node(&this->rb, &tn->rb, &rii->tn_root); in jffs2_add_tn_to_tree()
305 tn_erase(this, &rii->tn_root); in jffs2_add_tn_to_tree()
327 tn_erase(this, &rii->tn_root); in jffs2_add_tn_to_tree()
339 struct rb_node **link = &rii->tn_root.rb_node; in jffs2_add_tn_to_tree()
354 rb_insert_color(&tn->rb, &rii->tn_root); in jffs2_add_tn_to_tree()
450 struct jffs2_readinode_info *rii) in jffs2_build_inode_fragtree() argument
456 if (rii->mdata_tn) { in jffs2_build_inode_fragtree()
457 dbg_readinode("potential mdata is ver %d at %p\n", rii->mdata_tn->version, rii->mdata_tn); in jffs2_build_inode_fragtree()
458 high_ver = rii->mdata_tn->version; in jffs2_build_inode_fragtree()
459 rii->latest_ref = rii->mdata_tn->fn->raw; in jffs2_build_inode_fragtree()
462 this = tn_last(&rii->tn_root); in jffs2_build_inode_fragtree()
469 pen = tn_last(&rii->tn_root); in jffs2_build_inode_fragtree()
473 eat_last(&rii->tn_root, &last->rb); in jffs2_build_inode_fragtree()
509 rii->latest_ref = this->fn->raw; in jffs2_build_inode_fragtree()
605 struct jffs2_readinode_info *rii) in read_direntry() argument
655 if (fd->version > rii->highest_version) in read_direntry()
656 rii->highest_version = fd->version; in read_direntry()
659 if(fd->version > rii->mctime_ver && je32_to_cpu(rd->mctime)) { in read_direntry()
660 rii->mctime_ver = fd->version; in read_direntry()
661 rii->latest_mctime = je32_to_cpu(rd->mctime); in read_direntry()
698 jffs2_add_fd_to_list(c, fd, &rii->fds); in read_direntry()
712 struct jffs2_readinode_info *rii) in read_dnode() argument
843 if (tn->version > rii->highest_version) in read_dnode()
844 rii->highest_version = tn->version; in read_dnode()
857 ret = jffs2_add_tn_to_tree(c, rii, tn); in read_dnode()
867 tn = tn_first(&rii->tn_root); in read_dnode()
979 struct jffs2_readinode_info *rii) in jffs2_get_inode_nodes() argument
987 rii->mctime_ver = 0; in jffs2_get_inode_nodes()
1086 err = read_direntry(c, ref, &node->d, retlen, rii); in jffs2_get_inode_nodes()
1101 err = read_dnode(c, ref, &node->i, len, rii); in jffs2_get_inode_nodes()
1127 f->highest_version = rii->highest_version; in jffs2_get_inode_nodes()
1130 f->inocache->ino, rii->highest_version, rii->latest_mctime, in jffs2_get_inode_nodes()
1131 rii->mctime_ver); in jffs2_get_inode_nodes()
1135 jffs2_free_tmp_dnode_info_list(&rii->tn_root); in jffs2_get_inode_nodes()
1136 jffs2_free_full_dirent_list(rii->fds); in jffs2_get_inode_nodes()
1137 rii->fds = NULL; in jffs2_get_inode_nodes()
1146 struct jffs2_readinode_info rii; in jffs2_do_read_inode_internal() local
1154 memset(&rii, 0, sizeof(rii)); in jffs2_do_read_inode_internal()
1157 ret = jffs2_get_inode_nodes(c, f, &rii); in jffs2_do_read_inode_internal()
1166 ret = jffs2_build_inode_fragtree(c, f, &rii); in jffs2_do_read_inode_internal()
1172 jffs2_free_tmp_dnode_info_list(&rii.tn_root); in jffs2_do_read_inode_internal()
1174 if (rii.mdata_tn) { in jffs2_do_read_inode_internal()
1175 jffs2_free_full_dnode(rii.mdata_tn->fn); in jffs2_do_read_inode_internal()
1176 jffs2_free_tmp_dnode_info(rii.mdata_tn); in jffs2_do_read_inode_internal()
1177 rii.mdata_tn = NULL; in jffs2_do_read_inode_internal()
1182 if (rii.mdata_tn) { in jffs2_do_read_inode_internal()
1183 if (rii.mdata_tn->fn->raw == rii.latest_ref) { in jffs2_do_read_inode_internal()
1184 f->metadata = rii.mdata_tn->fn; in jffs2_do_read_inode_internal()
1185 jffs2_free_tmp_dnode_info(rii.mdata_tn); in jffs2_do_read_inode_internal()
1187 jffs2_kill_tn(c, rii.mdata_tn); in jffs2_do_read_inode_internal()
1189 rii.mdata_tn = NULL; in jffs2_do_read_inode_internal()
1192 f->dents = rii.fds; in jffs2_do_read_inode_internal()
1196 if (unlikely(!rii.latest_ref)) { in jffs2_do_read_inode_internal()
1200 if (!rii.fds) { in jffs2_do_read_inode_internal()
1218 …ret = jffs2_flash_read(c, ref_offset(rii.latest_ref), sizeof(*latest_node), &retlen, (void *)lates… in jffs2_do_read_inode_internal()
1231 f->inocache->ino, ref_offset(rii.latest_ref)); in jffs2_do_read_inode_internal()
1239 if (rii.mctime_ver > je32_to_cpu(latest_node->version)) { in jffs2_do_read_inode_internal()
1242 latest_node->ctime = latest_node->mtime = cpu_to_je32(rii.latest_mctime); in jffs2_do_read_inode_internal()
1277 ret = jffs2_flash_read(c, ref_offset(rii.latest_ref) + sizeof(*latest_node), in jffs2_do_read_inode_internal()