Lines Matching refs:rd
292 struct jffs2_raw_dirent *rd; in jffs2_symlink() local
386 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_symlink()
391 rd = jffs2_alloc_raw_dirent(); in jffs2_symlink()
392 if (!rd) { in jffs2_symlink()
402 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_symlink()
403 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_symlink()
404 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_symlink()
405 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_symlink()
407 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_symlink()
408 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_symlink()
409 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_symlink()
410 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_symlink()
411 rd->nsize = namelen; in jffs2_symlink()
412 rd->type = DT_LNK; in jffs2_symlink()
413 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_symlink()
414 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_symlink()
416 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_symlink()
422 jffs2_free_raw_dirent(rd); in jffs2_symlink()
429 inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); in jffs2_symlink()
431 jffs2_free_raw_dirent(rd); in jffs2_symlink()
456 struct jffs2_raw_dirent *rd; in jffs2_mkdir() local
531 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_mkdir()
536 rd = jffs2_alloc_raw_dirent(); in jffs2_mkdir()
537 if (!rd) { in jffs2_mkdir()
547 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_mkdir()
548 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_mkdir()
549 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_mkdir()
550 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_mkdir()
552 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_mkdir()
553 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_mkdir()
554 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_mkdir()
555 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_mkdir()
556 rd->nsize = namelen; in jffs2_mkdir()
557 rd->type = DT_DIR; in jffs2_mkdir()
558 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_mkdir()
559 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_mkdir()
561 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_mkdir()
567 jffs2_free_raw_dirent(rd); in jffs2_mkdir()
574 inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); in jffs2_mkdir()
577 jffs2_free_raw_dirent(rd); in jffs2_mkdir()
630 struct jffs2_raw_dirent *rd; in jffs2_mknod() local
707 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_mknod()
712 rd = jffs2_alloc_raw_dirent(); in jffs2_mknod()
713 if (!rd) { in jffs2_mknod()
723 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_mknod()
724 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_mknod()
725 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_mknod()
726 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_mknod()
728 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_mknod()
729 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_mknod()
730 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_mknod()
731 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_mknod()
732 rd->nsize = namelen; in jffs2_mknod()
735 rd->type = (mode & S_IFMT) >> 12; in jffs2_mknod()
737 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_mknod()
738 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_mknod()
740 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_mknod()
746 jffs2_free_raw_dirent(rd); in jffs2_mknod()
753 inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); in jffs2_mknod()
755 jffs2_free_raw_dirent(rd); in jffs2_mknod()