Lines Matching refs:ri
27 struct jffs2_raw_inode *ri; in jffs2_read_dnode() local
34 ri = jffs2_alloc_raw_inode(); in jffs2_read_dnode()
35 if (!ri) in jffs2_read_dnode()
38 ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (char *)ri); in jffs2_read_dnode()
40 jffs2_free_raw_inode(ri); in jffs2_read_dnode()
45 if (readlen != sizeof(*ri)) { in jffs2_read_dnode()
46 jffs2_free_raw_inode(ri); in jffs2_read_dnode()
48 ref_offset(fd->raw), sizeof(*ri), readlen); in jffs2_read_dnode()
51 crc = crc32(0, ri, sizeof(*ri)-8); in jffs2_read_dnode()
54 ref_offset(fd->raw), je32_to_cpu(ri->node_crc), in jffs2_read_dnode()
55 crc, je32_to_cpu(ri->dsize), je32_to_cpu(ri->csize), in jffs2_read_dnode()
56 je32_to_cpu(ri->offset), buf); in jffs2_read_dnode()
57 if (crc != je32_to_cpu(ri->node_crc)) { in jffs2_read_dnode()
59 je32_to_cpu(ri->node_crc), crc, ref_offset(fd->raw)); in jffs2_read_dnode()
65 if (ri->compr == JFFS2_COMPR_ZERO && !je32_to_cpu(ri->dsize) && in jffs2_read_dnode()
66 je32_to_cpu(ri->csize)) { in jffs2_read_dnode()
67 ri->dsize = ri->csize; in jffs2_read_dnode()
68 ri->csize = cpu_to_je32(0); in jffs2_read_dnode()
71 D1(if(ofs + len > je32_to_cpu(ri->dsize)) { in jffs2_read_dnode()
73 len, ofs, je32_to_cpu(ri->dsize)); in jffs2_read_dnode()
79 if (ri->compr == JFFS2_COMPR_ZERO) { in jffs2_read_dnode()
90 if (ri->compr == JFFS2_COMPR_NONE && len == je32_to_cpu(ri->dsize)) { in jffs2_read_dnode()
93 readbuf = kmalloc(je32_to_cpu(ri->csize), GFP_KERNEL); in jffs2_read_dnode()
99 if (ri->compr != JFFS2_COMPR_NONE) { in jffs2_read_dnode()
100 if (len < je32_to_cpu(ri->dsize)) { in jffs2_read_dnode()
101 decomprbuf = kmalloc(je32_to_cpu(ri->dsize), GFP_KERNEL); in jffs2_read_dnode()
113 jffs2_dbg(2, "Read %d bytes to %p\n", je32_to_cpu(ri->csize), in jffs2_read_dnode()
115 ret = jffs2_flash_read(c, (ref_offset(fd->raw)) + sizeof(*ri), in jffs2_read_dnode()
116 je32_to_cpu(ri->csize), &readlen, readbuf); in jffs2_read_dnode()
118 if (!ret && readlen != je32_to_cpu(ri->csize)) in jffs2_read_dnode()
123 crc = crc32(0, readbuf, je32_to_cpu(ri->csize)); in jffs2_read_dnode()
124 if (crc != je32_to_cpu(ri->data_crc)) { in jffs2_read_dnode()
126 je32_to_cpu(ri->data_crc), crc, ref_offset(fd->raw)); in jffs2_read_dnode()
131 if (ri->compr != JFFS2_COMPR_NONE) { in jffs2_read_dnode()
133 je32_to_cpu(ri->csize), readbuf, in jffs2_read_dnode()
134 je32_to_cpu(ri->dsize), decomprbuf); in jffs2_read_dnode()
135 …ret = jffs2_decompress(c, f, ri->compr | (ri->usercompr << 8), readbuf, decomprbuf, je32_to_cpu(ri… in jffs2_read_dnode()
142 if (len < je32_to_cpu(ri->dsize)) { in jffs2_read_dnode()
152 jffs2_free_raw_inode(ri); in jffs2_read_dnode()