Lines Matching refs:rd
206 struct jffs2_raw_dirent *rd, const unsigned char *name, in jffs2_write_dirent() argument
218 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino), in jffs2_write_dirent()
219 je32_to_cpu(rd->name_crc)); in jffs2_write_dirent()
221 D1(if(je32_to_cpu(rd->hdr_crc) != crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)) { in jffs2_write_dirent()
231 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino), in jffs2_write_dirent()
232 je32_to_cpu(rd->name_crc)); in jffs2_write_dirent()
237 vecs[0].iov_base = rd; in jffs2_write_dirent()
238 vecs[0].iov_len = sizeof(*rd); in jffs2_write_dirent()
246 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent()
247 fd->ino = je32_to_cpu(rd->ino); in jffs2_write_dirent()
249 fd->type = rd->type; in jffs2_write_dirent()
258 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) { in jffs2_write_dirent()
262 je32_to_cpu(rd->version), f->highest_version); in jffs2_write_dirent()
263 rd->version = cpu_to_je32(++f->highest_version); in jffs2_write_dirent()
264 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent()
265 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_write_dirent()
269 (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino)); in jffs2_write_dirent()
270 if (ret || (retlen != sizeof(*rd) + namelen)) { in jffs2_write_dirent()
272 sizeof(*rd) + namelen, flash_ofs, ret, retlen); in jffs2_write_dirent()
275 jffs2_add_physical_node_ref(c, flash_ofs | REF_OBSOLETE, PAD(sizeof(*rd)+namelen), NULL); in jffs2_write_dirent()
293 ret = jffs2_reserve_space_gc(c, sizeof(*rd) + namelen, &dummy, in jffs2_write_dirent()
300 ret = jffs2_reserve_space(c, sizeof(*rd) + namelen, &dummy, in jffs2_write_dirent()
321 fd->raw = jffs2_add_physical_node_ref(c, flash_ofs | dirent_node_state(rd), in jffs2_write_dirent()
322 PAD(sizeof(*rd)+namelen), f->inocache); in jffs2_write_dirent()
445 struct jffs2_raw_dirent *rd; in jffs2_do_create() local
492 ret = jffs2_reserve_space(c, sizeof(*rd)+qstr->len, &alloclen, in jffs2_do_create()
501 rd = jffs2_alloc_raw_dirent(); in jffs2_do_create()
502 if (!rd) { in jffs2_do_create()
510 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_do_create()
511 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_do_create()
512 rd->totlen = cpu_to_je32(sizeof(*rd) + qstr->len); in jffs2_do_create()
513 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_do_create()
515 rd->pino = cpu_to_je32(dir_f->inocache->ino); in jffs2_do_create()
516 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_do_create()
517 rd->ino = ri->ino; in jffs2_do_create()
518 rd->mctime = ri->ctime; in jffs2_do_create()
519 rd->nsize = qstr->len; in jffs2_do_create()
520 rd->type = DT_REG; in jffs2_do_create()
521 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_do_create()
522 rd->name_crc = cpu_to_je32(crc32(0, qstr->name, qstr->len)); in jffs2_do_create()
524 fd = jffs2_write_dirent(c, dir_f, rd, qstr->name, qstr->len, ALLOC_NORMAL); in jffs2_do_create()
526 jffs2_free_raw_dirent(rd); in jffs2_do_create()
551 struct jffs2_raw_dirent *rd; in jffs2_do_unlink() local
559 rd = jffs2_alloc_raw_dirent(); in jffs2_do_unlink()
560 if (!rd) in jffs2_do_unlink()
563 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_do_unlink()
566 jffs2_free_raw_dirent(rd); in jffs2_do_unlink()
573 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_do_unlink()
574 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_do_unlink()
575 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_do_unlink()
576 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_do_unlink()
578 rd->pino = cpu_to_je32(dir_f->inocache->ino); in jffs2_do_unlink()
579 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_do_unlink()
580 rd->ino = cpu_to_je32(0); in jffs2_do_unlink()
581 rd->mctime = cpu_to_je32(time); in jffs2_do_unlink()
582 rd->nsize = namelen; in jffs2_do_unlink()
583 rd->type = DT_UNKNOWN; in jffs2_do_unlink()
584 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_do_unlink()
585 rd->name_crc = cpu_to_je32(crc32(0, name, namelen)); in jffs2_do_unlink()
587 fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, ALLOC_DELETION); in jffs2_do_unlink()
589 jffs2_free_raw_dirent(rd); in jffs2_do_unlink()
671 struct jffs2_raw_dirent *rd; in jffs2_do_link() local
676 rd = jffs2_alloc_raw_dirent(); in jffs2_do_link()
677 if (!rd) in jffs2_do_link()
680 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_do_link()
683 jffs2_free_raw_dirent(rd); in jffs2_do_link()
690 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_do_link()
691 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_do_link()
692 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_do_link()
693 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_do_link()
695 rd->pino = cpu_to_je32(dir_f->inocache->ino); in jffs2_do_link()
696 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_do_link()
697 rd->ino = cpu_to_je32(ino); in jffs2_do_link()
698 rd->mctime = cpu_to_je32(time); in jffs2_do_link()
699 rd->nsize = namelen; in jffs2_do_link()
701 rd->type = type; in jffs2_do_link()
703 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_do_link()
704 rd->name_crc = cpu_to_je32(crc32(0, name, namelen)); in jffs2_do_link()
706 fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, ALLOC_NORMAL); in jffs2_do_link()
708 jffs2_free_raw_dirent(rd); in jffs2_do_link()