Lines Matching refs:ref
33 struct jffs2_raw_node_ref *ref = tn->fn->raw; in check_node_data() local
43 ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode); in check_node_data()
53 ref_offset(ref), tn->csize, ofs); in check_node_data()
62 ref_offset(ref), tn->csize, tn->partial_crc, tn->data_crc, ofs - len, ofs, len); in check_node_data()
109 ref_offset(ref), tn->data_crc, crc); in check_node_data()
114 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in check_node_data()
115 len = ref_totlen(c, jeb, ref); in check_node_data()
120 ref->flash_offset |= REF_PRISTINE; in check_node_data()
568 static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_ref *ref) in jffs2_first_valid_node() argument
570 while (ref && ref->next_in_ino) { in jffs2_first_valid_node()
571 if (!ref_obsolete(ref)) in jffs2_first_valid_node()
572 return ref; in jffs2_first_valid_node()
573 dbg_noderef("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref)); in jffs2_first_valid_node()
574 ref = ref->next_in_ino; in jffs2_first_valid_node()
586 static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, in read_direntry() argument
594 BUG_ON(ref_obsolete(ref)); in read_direntry()
599 ref_offset(ref), je32_to_cpu(rd->node_crc), crc); in read_direntry()
600 jffs2_mark_node_obsolete(c, ref); in read_direntry()
605 if (ref_flags(ref) == REF_UNCHECKED) { in read_direntry()
612 ref_offset(ref), rd->nsize, je32_to_cpu(rd->totlen)); in read_direntry()
613 jffs2_mark_node_obsolete(c, ref); in read_direntry()
617 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in read_direntry()
618 len = ref_totlen(c, jeb, ref); in read_direntry()
625 ref->flash_offset = ref_offset(ref) | dirent_node_state(rd); in read_direntry()
633 fd->raw = ref; in read_direntry()
661 err = jffs2_flash_read(c, (ref_offset(ref)) + read, in read_direntry()
685 ref_offset(ref), je32_to_cpu(rd->node_crc), crc); in read_direntry()
686 jffs2_mark_node_obsolete(c, ref); in read_direntry()
713 static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, in read_dnode() argument
723 BUG_ON(ref_obsolete(ref)); in read_dnode()
728 ref_offset(ref), je32_to_cpu(rd->node_crc), crc); in read_dnode()
729 jffs2_mark_node_obsolete(c, ref); in read_dnode()
743 if (ref_flags(ref) == REF_UNCHECKED) { in read_dnode()
748 JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); in read_dnode()
749 jffs2_dbg_dump_node(c, ref_offset(ref)); in read_dnode()
750 jffs2_mark_node_obsolete(c, ref); in read_dnode()
804 ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc)); in read_dnode()
805 jffs2_mark_node_obsolete(c, ref); in read_dnode()
819 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in read_dnode()
820 len = ref_totlen(c, jeb, ref); in read_dnode()
827 ref->flash_offset = ref_offset(ref) | REF_NORMAL; in read_dnode()
843 tn->fn->raw = ref; in read_dnode()
857 ref_offset(ref), je32_to_cpu(rd->version), in read_dnode()
888 static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs… in read_unknown() argument
891 if (ref_flags(ref) == REF_UNCHECKED) { in read_unknown()
893 ref_offset(ref)); in read_unknown()
897 jffs2_mark_node_obsolete(c, ref); in read_unknown()
907 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
914 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
920 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
925 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
926 jffs2_mark_node_obsolete(c, ref); in read_unknown()
940 static int read_more(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, in read_more() argument
955 offs = ref_offset(ref) + *rdlen; in read_more()
984 struct jffs2_raw_node_ref *ref, *valid_ref; in jffs2_get_inode_nodes() local
1012 ref = valid_ref; in jffs2_get_inode_nodes()
1013 valid_ref = jffs2_first_valid_node(ref->next_in_ino); in jffs2_get_inode_nodes()
1035 end = ref_offset(ref) + len; in jffs2_get_inode_nodes()
1039 len = end - ref_offset(ref); in jffs2_get_inode_nodes()
1042 dbg_readinode("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref)); in jffs2_get_inode_nodes()
1045 err = jffs2_flash_read(c, ref_offset(ref), len, &retlen, buf); in jffs2_get_inode_nodes()
1047 JFFS2_ERROR("can not read %d bytes from 0x%08x, error code: %d.\n", len, ref_offset(ref), err); in jffs2_get_inode_nodes()
1052 JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n", ref_offset(ref), retlen, len); in jffs2_get_inode_nodes()
1062 ref_offset(ref), je16_to_cpu(node->u.magic), in jffs2_get_inode_nodes()
1066 jffs2_dbg_dump_node(c, ref_offset(ref)); in jffs2_get_inode_nodes()
1067 jffs2_mark_node_obsolete(c, ref); in jffs2_get_inode_nodes()
1073 je16_to_cpu(node->u.magic), ref_offset(ref)); in jffs2_get_inode_nodes()
1074 jffs2_mark_node_obsolete(c, ref); in jffs2_get_inode_nodes()
1084 err = read_more(c, ref, sizeof(struct jffs2_raw_dirent), &len, buf); in jffs2_get_inode_nodes()
1089 err = read_direntry(c, ref, &node->d, retlen, rii); in jffs2_get_inode_nodes()
1099 err = read_more(c, ref, sizeof(struct jffs2_raw_inode), &len, buf); in jffs2_get_inode_nodes()
1104 err = read_dnode(c, ref, &node->i, len, rii); in jffs2_get_inode_nodes()
1113 err = read_more(c, ref, sizeof(struct jffs2_unknown_node), &len, buf); in jffs2_get_inode_nodes()
1118 err = read_unknown(c, ref, &node->u); in jffs2_get_inode_nodes()