Lines Matching refs:ofs
47 struct jffs2_raw_inode *ri, uint32_t ofs, struct jffs2_summary *s);
49 struct jffs2_raw_dirent *rd, uint32_t ofs, struct jffs2_summary *s);
291 uint32_t ofs, uint32_t len) in jffs2_fill_scan_buf() argument
296 ret = jffs2_flash_read(c, ofs, len, &retlen, buf); in jffs2_fill_scan_buf()
299 len, ofs, ret); in jffs2_fill_scan_buf()
304 ofs, retlen); in jffs2_fill_scan_buf()
331 struct jffs2_raw_xattr *rx, uint32_t ofs, in jffs2_scan_xattr_node() argument
341 ofs, je32_to_cpu(rx->node_crc), crc); in jffs2_scan_xattr_node()
354 ofs, je32_to_cpu(rx->totlen), totlen); in jffs2_scan_xattr_node()
366 = jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, totlen, NULL); in jffs2_scan_xattr_node()
376 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, totlen, (void *)xd); in jffs2_scan_xattr_node()
380 jffs2_sum_add_xattr_mem(s, rx, ofs - jeb->offset); in jffs2_scan_xattr_node()
382 ofs, xd->xid, xd->version); in jffs2_scan_xattr_node()
387 struct jffs2_raw_xref *rr, uint32_t ofs, in jffs2_scan_xref_node() argument
397 ofs, je32_to_cpu(rr->node_crc), crc); in jffs2_scan_xref_node()
405 ofs, je32_to_cpu(rr->totlen), in jffs2_scan_xref_node()
433 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, PAD(je32_to_cpu(rr->totlen)), (void *)ref); in jffs2_scan_xref_node()
436 jffs2_sum_add_xref_mem(s, rr, ofs - jeb->offset); in jffs2_scan_xref_node()
438 ofs, ref->xid, ref->ino); in jffs2_scan_xref_node()
449 uint32_t ofs, prevofs, max_ofs; in jffs2_scan_eraseblock() local
459 ofs = jeb->offset; in jffs2_scan_eraseblock()
462 jffs2_dbg(1, "%s(): Scanning block at 0x%x\n", __func__, ofs); in jffs2_scan_eraseblock()
571 ofs = 0; in jffs2_scan_eraseblock()
574 while(ofs < max_ofs && *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF) in jffs2_scan_eraseblock()
575 ofs += 4; in jffs2_scan_eraseblock()
577 if (ofs == max_ofs) { in jffs2_scan_eraseblock()
598 if (ofs) { in jffs2_scan_eraseblock()
600 jeb->offset + ofs); in jffs2_scan_eraseblock()
603 if ((err = jffs2_scan_dirty_space(c, jeb, ofs))) in jffs2_scan_eraseblock()
608 ofs += jeb->offset; in jffs2_scan_eraseblock()
615 while(ofs < jeb->offset + c->sector_size) { in jffs2_scan_eraseblock()
626 if (ofs & 3) { in jffs2_scan_eraseblock()
627 pr_warn("Eep. ofs 0x%08x not word-aligned!\n", ofs); in jffs2_scan_eraseblock()
628 ofs = PAD(ofs); in jffs2_scan_eraseblock()
631 if (ofs == prevofs) { in jffs2_scan_eraseblock()
633 ofs); in jffs2_scan_eraseblock()
636 ofs += 4; in jffs2_scan_eraseblock()
639 prevofs = ofs; in jffs2_scan_eraseblock()
641 if (jeb->offset + c->sector_size < ofs + sizeof(*node)) { in jffs2_scan_eraseblock()
644 jeb->offset, c->sector_size, ofs, in jffs2_scan_eraseblock()
646 if ((err = jffs2_scan_dirty_space(c, jeb, (jeb->offset + c->sector_size)-ofs))) in jffs2_scan_eraseblock()
651 if (buf_ofs + buf_len < ofs + sizeof(*node)) { in jffs2_scan_eraseblock()
652 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
655 buf_len, ofs); in jffs2_scan_eraseblock()
656 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
659 buf_ofs = ofs; in jffs2_scan_eraseblock()
662 node = (struct jffs2_unknown_node *)&buf[ofs-buf_ofs]; in jffs2_scan_eraseblock()
664 if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0xffffffff) { in jffs2_scan_eraseblock()
668 empty_start = ofs; in jffs2_scan_eraseblock()
669 ofs += 4; in jffs2_scan_eraseblock()
672 jffs2_dbg(1, "Found empty flash at 0x%08x\n", ofs); in jffs2_scan_eraseblock()
674 inbuf_ofs = ofs - buf_ofs; in jffs2_scan_eraseblock()
678 empty_start, ofs); in jffs2_scan_eraseblock()
679 if ((err = jffs2_scan_dirty_space(c, jeb, ofs-empty_start))) in jffs2_scan_eraseblock()
685 ofs += 4; in jffs2_scan_eraseblock()
689 ofs); in jffs2_scan_eraseblock()
705 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
716 buf_len, ofs); in jffs2_scan_eraseblock()
717 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
720 buf_ofs = ofs; in jffs2_scan_eraseblock()
724 if (ofs == jeb->offset && je16_to_cpu(node->magic) == KSAMTIB_CIGAM_2SFFJ) { in jffs2_scan_eraseblock()
726 ofs); in jffs2_scan_eraseblock()
729 ofs += 4; in jffs2_scan_eraseblock()
733 jffs2_dbg(1, "Dirty bitmask at 0x%08x\n", ofs); in jffs2_scan_eraseblock()
736 ofs += 4; in jffs2_scan_eraseblock()
740 pr_warn("Old JFFS2 bitmask found at 0x%08x\n", ofs); in jffs2_scan_eraseblock()
744 ofs += 4; in jffs2_scan_eraseblock()
751 JFFS2_MAGIC_BITMASK, ofs, in jffs2_scan_eraseblock()
755 ofs += 4; in jffs2_scan_eraseblock()
767 ofs, je16_to_cpu(node->magic), in jffs2_scan_eraseblock()
774 ofs += 4; in jffs2_scan_eraseblock()
778 if (ofs + je32_to_cpu(node->totlen) > jeb->offset + c->sector_size) { in jffs2_scan_eraseblock()
781 ofs, je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
785 ofs += 4; in jffs2_scan_eraseblock()
792 ofs); in jffs2_scan_eraseblock()
795 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
801 if (buf_ofs + buf_len < ofs + sizeof(struct jffs2_raw_inode)) { in jffs2_scan_eraseblock()
802 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
805 buf_len, ofs); in jffs2_scan_eraseblock()
806 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
809 buf_ofs = ofs; in jffs2_scan_eraseblock()
812 err = jffs2_scan_inode_node(c, jeb, (void *)node, ofs, s); in jffs2_scan_eraseblock()
814 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
818 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) { in jffs2_scan_eraseblock()
819 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
822 ofs); in jffs2_scan_eraseblock()
823 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
826 buf_ofs = ofs; in jffs2_scan_eraseblock()
829 err = jffs2_scan_dirent_node(c, jeb, (void *)node, ofs, s); in jffs2_scan_eraseblock()
831 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
836 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) { in jffs2_scan_eraseblock()
837 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
840 ofs); in jffs2_scan_eraseblock()
841 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
844 buf_ofs = ofs; in jffs2_scan_eraseblock()
847 err = jffs2_scan_xattr_node(c, jeb, (void *)node, ofs, s); in jffs2_scan_eraseblock()
850 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
853 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) { in jffs2_scan_eraseblock()
854 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); in jffs2_scan_eraseblock()
857 ofs); in jffs2_scan_eraseblock()
858 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); in jffs2_scan_eraseblock()
861 buf_ofs = ofs; in jffs2_scan_eraseblock()
864 err = jffs2_scan_xref_node(c, jeb, (void *)node, ofs, s); in jffs2_scan_eraseblock()
867 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
872 jffs2_dbg(1, "CLEANMARKER node found at 0x%08x\n", ofs); in jffs2_scan_eraseblock()
875 ofs, je32_to_cpu(node->totlen), in jffs2_scan_eraseblock()
879 ofs += PAD(sizeof(struct jffs2_unknown_node)); in jffs2_scan_eraseblock()
882 ofs, jeb->offset); in jffs2_scan_eraseblock()
885 ofs += PAD(sizeof(struct jffs2_unknown_node)); in jffs2_scan_eraseblock()
887 jffs2_link_node_ref(c, jeb, ofs | REF_NORMAL, c->cleanmarker_size, NULL); in jffs2_scan_eraseblock()
889 ofs += PAD(c->cleanmarker_size); in jffs2_scan_eraseblock()
898 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
905 je16_to_cpu(node->nodetype), ofs); in jffs2_scan_eraseblock()
911 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
916 je16_to_cpu(node->nodetype), ofs); in jffs2_scan_eraseblock()
921 je16_to_cpu(node->nodetype), ofs); in jffs2_scan_eraseblock()
924 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
929 je16_to_cpu(node->nodetype), ofs); in jffs2_scan_eraseblock()
931 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, PAD(je32_to_cpu(node->totlen)), NULL); in jffs2_scan_eraseblock()
935 ofs += PAD(je32_to_cpu(node->totlen)); in jffs2_scan_eraseblock()
992 struct jffs2_raw_inode *ri, uint32_t ofs, struct jffs2_summary *s) in jffs2_scan_inode_node() argument
997 jffs2_dbg(1, "%s(): Node at 0x%08x\n", __func__, ofs); in jffs2_scan_inode_node()
1012 __func__, ofs, je32_to_cpu(ri->node_crc), crc); in jffs2_scan_inode_node()
1029 jffs2_link_node_ref(c, jeb, ofs | REF_UNCHECKED, PAD(je32_to_cpu(ri->totlen)), ic); in jffs2_scan_inode_node()
1039 jffs2_sum_add_inode_mem(s, ri, ofs - jeb->offset); in jffs2_scan_inode_node()
1046 struct jffs2_raw_dirent *rd, uint32_t ofs, struct jffs2_summary *s) in jffs2_scan_dirent_node() argument
1054 jffs2_dbg(1, "%s(): Node at 0x%08x\n", __func__, ofs); in jffs2_scan_dirent_node()
1062 __func__, ofs, je32_to_cpu(rd->node_crc), crc); in jffs2_scan_dirent_node()
1075 ofs, checkedlen); in jffs2_scan_dirent_node()
1087 __func__, ofs, je32_to_cpu(rd->name_crc), crc); in jffs2_scan_dirent_node()
1103 fd->raw = jffs2_link_node_ref(c, jeb, ofs | dirent_node_state(rd), in jffs2_scan_dirent_node()
1114 jffs2_sum_add_dirent_mem(s, rd, ofs - jeb->offset); in jffs2_scan_dirent_node()