Lines Matching refs:ri
762 struct jffs2_raw_inode ri; in jffs2_garbage_collect_metadata() local
796 ret = jffs2_reserve_space_gc(c, sizeof(ri) + mdatalen, &alloclen, in jffs2_garbage_collect_metadata()
800 sizeof(ri) + mdatalen, ret); in jffs2_garbage_collect_metadata()
812 memset(&ri, 0, sizeof(ri)); in jffs2_garbage_collect_metadata()
813 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_garbage_collect_metadata()
814 ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); in jffs2_garbage_collect_metadata()
815 ri.totlen = cpu_to_je32(sizeof(ri) + mdatalen); in jffs2_garbage_collect_metadata()
816 ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); in jffs2_garbage_collect_metadata()
818 ri.ino = cpu_to_je32(f->inocache->ino); in jffs2_garbage_collect_metadata()
819 ri.version = cpu_to_je32(++f->highest_version); in jffs2_garbage_collect_metadata()
820 ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); in jffs2_garbage_collect_metadata()
821 ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); in jffs2_garbage_collect_metadata()
822 ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); in jffs2_garbage_collect_metadata()
823 ri.isize = cpu_to_je32(ilen); in jffs2_garbage_collect_metadata()
824 ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); in jffs2_garbage_collect_metadata()
825 ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); in jffs2_garbage_collect_metadata()
826 ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); in jffs2_garbage_collect_metadata()
827 ri.offset = cpu_to_je32(0); in jffs2_garbage_collect_metadata()
828 ri.csize = cpu_to_je32(mdatalen); in jffs2_garbage_collect_metadata()
829 ri.dsize = cpu_to_je32(mdatalen); in jffs2_garbage_collect_metadata()
830 ri.compr = JFFS2_COMPR_NONE; in jffs2_garbage_collect_metadata()
831 ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); in jffs2_garbage_collect_metadata()
832 ri.data_crc = cpu_to_je32(crc32(0, mdata, mdatalen)); in jffs2_garbage_collect_metadata()
834 new_fn = jffs2_write_dnode(c, f, &ri, mdata, mdatalen, ALLOC_GC); in jffs2_garbage_collect_metadata()
1017 struct jffs2_raw_inode ri; in jffs2_garbage_collect_hole() local
1026 memset(&ri, 0, sizeof(ri)); in jffs2_garbage_collect_hole()
1033 ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(ri), &readlen, (char *)&ri); in jffs2_garbage_collect_hole()
1034 if (readlen != sizeof(ri) || ret) { in jffs2_garbage_collect_hole()
1039 if (je16_to_cpu(ri.nodetype) != JFFS2_NODETYPE_INODE) { in jffs2_garbage_collect_hole()
1042 je16_to_cpu(ri.nodetype), JFFS2_NODETYPE_INODE); in jffs2_garbage_collect_hole()
1045 if (je32_to_cpu(ri.totlen) != sizeof(ri)) { in jffs2_garbage_collect_hole()
1048 je32_to_cpu(ri.totlen), sizeof(ri)); in jffs2_garbage_collect_hole()
1051 crc = crc32(0, &ri, sizeof(ri)-8); in jffs2_garbage_collect_hole()
1052 if (crc != je32_to_cpu(ri.node_crc)) { in jffs2_garbage_collect_hole()
1055 je32_to_cpu(ri.node_crc), crc); in jffs2_garbage_collect_hole()
1061 if (ri.compr != JFFS2_COMPR_ZERO) { in jffs2_garbage_collect_hole()
1070 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_garbage_collect_hole()
1071 ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); in jffs2_garbage_collect_hole()
1072 ri.totlen = cpu_to_je32(sizeof(ri)); in jffs2_garbage_collect_hole()
1073 ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); in jffs2_garbage_collect_hole()
1075 ri.ino = cpu_to_je32(f->inocache->ino); in jffs2_garbage_collect_hole()
1076 ri.version = cpu_to_je32(++f->highest_version); in jffs2_garbage_collect_hole()
1077 ri.offset = cpu_to_je32(start); in jffs2_garbage_collect_hole()
1078 ri.dsize = cpu_to_je32(end - start); in jffs2_garbage_collect_hole()
1079 ri.csize = cpu_to_je32(0); in jffs2_garbage_collect_hole()
1080 ri.compr = JFFS2_COMPR_ZERO; in jffs2_garbage_collect_hole()
1091 ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); in jffs2_garbage_collect_hole()
1092 ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); in jffs2_garbage_collect_hole()
1093 ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); in jffs2_garbage_collect_hole()
1094 ri.isize = cpu_to_je32(ilen); in jffs2_garbage_collect_hole()
1095 ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); in jffs2_garbage_collect_hole()
1096 ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); in jffs2_garbage_collect_hole()
1097 ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); in jffs2_garbage_collect_hole()
1098 ri.data_crc = cpu_to_je32(0); in jffs2_garbage_collect_hole()
1099 ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); in jffs2_garbage_collect_hole()
1101 ret = jffs2_reserve_space_gc(c, sizeof(ri), &alloclen, in jffs2_garbage_collect_hole()
1105 sizeof(ri), ret); in jffs2_garbage_collect_hole()
1108 new_fn = jffs2_write_dnode(c, f, &ri, NULL, 0, ALLOC_GC); in jffs2_garbage_collect_hole()
1114 if (je32_to_cpu(ri.version) == f->highest_version) { in jffs2_garbage_collect_hole()
1132 __func__, fn->frags, je32_to_cpu(ri.version), in jffs2_garbage_collect_hole()
1133 f->highest_version, je32_to_cpu(ri.ino)); in jffs2_garbage_collect_hole()
1170 struct jffs2_raw_inode ri; in jffs2_garbage_collect_dnode() local
1177 memset(&ri, 0, sizeof(ri)); in jffs2_garbage_collect_dnode()
1347 ret = jffs2_reserve_space_gc(c, sizeof(ri) + JFFS2_MIN_DATA_LEN, in jffs2_garbage_collect_dnode()
1352 sizeof(ri) + JFFS2_MIN_DATA_LEN, ret); in jffs2_garbage_collect_dnode()
1355 cdatalen = min_t(uint32_t, alloclen - sizeof(ri), end - offset); in jffs2_garbage_collect_dnode()
1362 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_garbage_collect_dnode()
1363 ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); in jffs2_garbage_collect_dnode()
1364 ri.totlen = cpu_to_je32(sizeof(ri) + cdatalen); in jffs2_garbage_collect_dnode()
1365 ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); in jffs2_garbage_collect_dnode()
1367 ri.ino = cpu_to_je32(f->inocache->ino); in jffs2_garbage_collect_dnode()
1368 ri.version = cpu_to_je32(++f->highest_version); in jffs2_garbage_collect_dnode()
1369 ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); in jffs2_garbage_collect_dnode()
1370 ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); in jffs2_garbage_collect_dnode()
1371 ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); in jffs2_garbage_collect_dnode()
1372 ri.isize = cpu_to_je32(JFFS2_F_I_SIZE(f)); in jffs2_garbage_collect_dnode()
1373 ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); in jffs2_garbage_collect_dnode()
1374 ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); in jffs2_garbage_collect_dnode()
1375 ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); in jffs2_garbage_collect_dnode()
1376 ri.offset = cpu_to_je32(offset); in jffs2_garbage_collect_dnode()
1377 ri.csize = cpu_to_je32(cdatalen); in jffs2_garbage_collect_dnode()
1378 ri.dsize = cpu_to_je32(datalen); in jffs2_garbage_collect_dnode()
1379 ri.compr = comprtype & 0xff; in jffs2_garbage_collect_dnode()
1380 ri.usercompr = (comprtype >> 8) & 0xff; in jffs2_garbage_collect_dnode()
1381 ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); in jffs2_garbage_collect_dnode()
1382 ri.data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen)); in jffs2_garbage_collect_dnode()
1384 new_fn = jffs2_write_dnode(c, f, &ri, comprbuf, cdatalen, ALLOC_GC); in jffs2_garbage_collect_dnode()