• Home
  • Raw
  • Download

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()
697 static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, in read_dnode() argument
707 BUG_ON(ref_obsolete(ref)); in read_dnode()
712 ref_offset(ref), je32_to_cpu(rd->node_crc), crc); in read_dnode()
713 jffs2_mark_node_obsolete(c, ref); in read_dnode()
727 if (ref_flags(ref) == REF_UNCHECKED) { in read_dnode()
732 JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); in read_dnode()
733 jffs2_dbg_dump_node(c, ref_offset(ref)); in read_dnode()
734 jffs2_mark_node_obsolete(c, ref); in read_dnode()
788 ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc)); in read_dnode()
789 jffs2_mark_node_obsolete(c, ref); in read_dnode()
803 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in read_dnode()
804 len = ref_totlen(c, jeb, ref); in read_dnode()
811 ref->flash_offset = ref_offset(ref) | REF_NORMAL; in read_dnode()
827 tn->fn->raw = ref; in read_dnode()
841 ref_offset(ref), je32_to_cpu(rd->version), in read_dnode()
872 static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs… in read_unknown() argument
875 if (ref_flags(ref) == REF_UNCHECKED) { in read_unknown()
877 ref_offset(ref)); in read_unknown()
881 jffs2_mark_node_obsolete(c, ref); in read_unknown()
891 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
898 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
904 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
909 je16_to_cpu(un->nodetype), ref_offset(ref)); in read_unknown()
910 jffs2_mark_node_obsolete(c, ref); in read_unknown()
924 static int read_more(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, in read_more() argument
939 offs = ref_offset(ref) + *rdlen; in read_more()
968 struct jffs2_raw_node_ref *ref, *valid_ref; in jffs2_get_inode_nodes() local
996 ref = valid_ref; in jffs2_get_inode_nodes()
997 valid_ref = jffs2_first_valid_node(ref->next_in_ino); in jffs2_get_inode_nodes()
1019 end = ref_offset(ref) + len; in jffs2_get_inode_nodes()
1023 len = end - ref_offset(ref); in jffs2_get_inode_nodes()
1026 dbg_readinode("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref)); in jffs2_get_inode_nodes()
1029 err = jffs2_flash_read(c, ref_offset(ref), len, &retlen, buf); in jffs2_get_inode_nodes()
1031 JFFS2_ERROR("can not read %d bytes from 0x%08x, error code: %d.\n", len, ref_offset(ref), err); in jffs2_get_inode_nodes()
1036 JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n", ref_offset(ref), retlen, len); in jffs2_get_inode_nodes()
1046 ref_offset(ref), je16_to_cpu(node->u.magic), in jffs2_get_inode_nodes()
1050 jffs2_dbg_dump_node(c, ref_offset(ref)); in jffs2_get_inode_nodes()
1051 jffs2_mark_node_obsolete(c, ref); in jffs2_get_inode_nodes()
1057 je16_to_cpu(node->u.magic), ref_offset(ref)); in jffs2_get_inode_nodes()
1058 jffs2_mark_node_obsolete(c, ref); in jffs2_get_inode_nodes()
1068 err = read_more(c, ref, sizeof(struct jffs2_raw_dirent), &len, buf); in jffs2_get_inode_nodes()
1073 err = read_direntry(c, ref, &node->d, retlen, rii); in jffs2_get_inode_nodes()
1083 err = read_more(c, ref, sizeof(struct jffs2_raw_inode), &len, buf); in jffs2_get_inode_nodes()
1088 err = read_dnode(c, ref, &node->i, len, rii); in jffs2_get_inode_nodes()
1097 err = read_more(c, ref, sizeof(struct jffs2_unknown_node), &len, buf); in jffs2_get_inode_nodes()
1102 err = read_unknown(c, ref, &node->u); in jffs2_get_inode_nodes()