• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/jffs2/

Lines Matching defs:ofs

40 /* These helper functions _must_ increase ofs and also do the dirty/used space accounting.
45 struct jffs2_raw_inode *ri, uint32_t ofs, struct jffs2_summary *s);
47 struct jffs2_raw_dirent *rd, uint32_t ofs, struct jffs2_summary *s);
282 uint32_t ofs, uint32_t len)
287 ret = jffs2_flash_read(c, ofs, len, &retlen, buf);
289 D1(printk(KERN_WARNING "mtd->read(0x%x bytes from 0x%x) returned %d\n", len, ofs, ret));
293 D1(printk(KERN_WARNING "Read at 0x%x gave only 0x%zx bytes\n", ofs, retlen));
320 struct jffs2_raw_xattr *rx, uint32_t ofs,
330 ofs, je32_to_cpu(rx->node_crc), crc);
343 ofs, je32_to_cpu(rx->totlen), totlen);
355 = jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, totlen, NULL);
365 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, totlen, (void *)xd);
369 jffs2_sum_add_xattr_mem(s, rx, ofs - jeb->offset);
371 ofs, xd->xid, xd->version);
376 struct jffs2_raw_xref *rr, uint32_t ofs,
386 ofs, je32_to_cpu(rr->node_crc), crc);
394 ofs, je32_to_cpu(rr->totlen),
422 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, PAD(je32_to_cpu(rr->totlen)), (void *)ref);
425 jffs2_sum_add_xref_mem(s, rr, ofs - jeb->offset);
427 ofs, ref->xid, ref->ino);
438 uint32_t ofs, prevofs;
448 ofs = jeb->offset;
451 D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs));
551 /* We temporarily use 'ofs' as a pointer into the buffer/jeb */
552 ofs = 0;
555 while(ofs < EMPTY_SCAN_SIZE(c->sector_size) && *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF)
556 ofs += 4;
558 if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) {
577 if (ofs) {
579 jeb->offset + ofs));
582 if ((err = jffs2_scan_dirty_space(c, jeb, ofs)))
586 /* Now ofs is a complete physical flash offset as it always was... */
587 ofs += jeb->offset;
594 while(ofs < jeb->offset + c->sector_size) {
605 if (ofs & 3) {
606 printk(KERN_WARNING "Eep. ofs 0x%08x not word-aligned!\n", ofs);
607 ofs = PAD(ofs);
610 if (ofs == prevofs) {
611 printk(KERN_WARNING "ofs 0x%08x has already been seen. Skipping\n", ofs);
614 ofs += 4;
617 prevofs = ofs;
619 if (jeb->offset + c->sector_size < ofs + sizeof(*node)) {
621 jeb->offset, c->sector_size, ofs, sizeof(*node)));
622 if ((err = jffs2_scan_dirty_space(c, jeb, (jeb->offset + c->sector_size)-ofs)))
627 if (buf_ofs + buf_len < ofs + sizeof(*node)) {
628 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
630 sizeof(struct jffs2_unknown_node), buf_len, ofs));
631 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
634 buf_ofs = ofs;
637 node = (struct jffs2_unknown_node *)&buf[ofs-buf_ofs];
639 if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0xffffffff) {
643 empty_start = ofs;
644 ofs += 4;
647 D1(printk(KERN_DEBUG "Found empty flash at 0x%08x\n", ofs));
649 inbuf_ofs = ofs - buf_ofs;
653 empty_start, ofs);
654 if ((err = jffs2_scan_dirty_space(c, jeb, ofs-empty_start)))
660 ofs += 4;
663 D1(printk(KERN_DEBUG "Empty flash to end of buffer at 0x%08x\n", ofs));
678 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
688 D1(printk(KERN_DEBUG "Reading another 0x%x at 0x%08x\n", buf_len, ofs));
689 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
692 buf_ofs = ofs;
696 if (ofs == jeb->offset && je16_to_cpu(node->magic) == KSAMTIB_CIGAM_2SFFJ) {
697 printk(KERN_WARNING "Magic bitmask is backwards at offset 0x%08x. Wrong endian filesystem?\n", ofs);
700 ofs += 4;
704 D1(printk(KERN_DEBUG "Dirty bitmask at 0x%08x\n", ofs));
707 ofs += 4;
711 printk(KERN_WARNING "Old JFFS2 bitmask found at 0x%08x\n", ofs);
715 ofs += 4;
721 JFFS2_MAGIC_BITMASK, ofs,
725 ofs += 4;
736 ofs, je16_to_cpu(node->magic),
743 ofs += 4;
747 if (ofs + je32_to_cpu(node->totlen) > jeb->offset + c->sector_size) {
750 ofs, je32_to_cpu(node->totlen));
754 ofs += 4;
760 D2(printk(KERN_DEBUG "Node at 0x%08x is obsolete. Skipping\n", ofs));
763 ofs += PAD(je32_to_cpu(node->totlen));
769 if (buf_ofs + buf_len < ofs + sizeof(struct jffs2_raw_inode)) {
770 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
772 sizeof(struct jffs2_raw_inode), buf_len, ofs));
773 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
776 buf_ofs = ofs;
779 err = jffs2_scan_inode_node(c, jeb, (void *)node, ofs, s);
781 ofs += PAD(je32_to_cpu(node->totlen));
785 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) {
786 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
788 je32_to_cpu(node->totlen), buf_len, ofs));
789 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
792 buf_ofs = ofs;
795 err = jffs2_scan_dirent_node(c, jeb, (void *)node, ofs, s);
797 ofs += PAD(je32_to_cpu(node->totlen));
802 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) {
803 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
806 je32_to_cpu(node->totlen), buf_len, ofs));
807 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
810 buf_ofs = ofs;
813 err = jffs2_scan_xattr_node(c, jeb, (void *)node, ofs, s);
816 ofs += PAD(je32_to_cpu(node->totlen));
819 if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) {
820 buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
823 je32_to_cpu(node->totlen), buf_len, ofs));
824 err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
827 buf_ofs = ofs;
830 err = jffs2_scan_xref_node(c, jeb, (void *)node, ofs, s);
833 ofs += PAD(je32_to_cpu(node->totlen));
838 D1(printk(KERN_DEBUG "CLEANMARKER node found at 0x%08x\n", ofs));
841 ofs, je32_to_cpu(node->totlen), c->cleanmarker_size);
844 ofs += PAD(sizeof(struct jffs2_unknown_node));
846 printk(KERN_NOTICE "CLEANMARKER node found at 0x%08x, not first node in block (0x%08x)\n", ofs, jeb->offset);
849 ofs += PAD(sizeof(struct jffs2_unknown_node));
851 jffs2_link_node_ref(c, jeb, ofs | REF_NORMAL, c->cleanmarker_size, NULL);
853 ofs += PAD(c->cleanmarker_size);
862 ofs += PAD(je32_to_cpu(node->totlen));
868 printk(KERN_NOTICE "Read-only compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs);
874 ofs += PAD(je32_to_cpu(node->totlen));
878 printk(KERN_NOTICE "Incompatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs);
882 D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs));
885 ofs += PAD(je32_to_cpu(node->totlen));
889 D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs));
891 jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, PAD(je32_to_cpu(node->totlen)), NULL);
895 ofs += PAD(je32_to_cpu(node->totlen));
951 struct jffs2_raw_inode *ri, uint32_t ofs, struct jffs2_summary *s)
956 D1(printk(KERN_DEBUG "jffs2_scan_inode_node(): Node at 0x%08x\n", ofs));
972 ofs, je32_to_cpu(ri->node_crc), crc);
989 jffs2_link_node_ref(c, jeb, ofs | REF_UNCHECKED, PAD(je32_to_cpu(ri->totlen)), ic);
999 jffs2_sum_add_inode_mem(s, ri, ofs - jeb->offset);
1006 struct jffs2_raw_dirent *rd, uint32_t ofs, struct jffs2_summary *s)
1014 D1(printk(KERN_DEBUG "jffs2_scan_dirent_node(): Node at 0x%08x\n", ofs));
1022 ofs, je32_to_cpu(rd->node_crc), crc);
1035 ofs, checkedlen);
1047 ofs, je32_to_cpu(rd->name_crc), crc);
1061 fd->raw = jffs2_link_node_ref(c, jeb, ofs | dirent_node_state(rd),
1072 jffs2_sum_add_dirent_mem(s, rd, ofs - jeb->offset);