Lines Matching refs:rd

285 	struct jffs2_raw_dirent *rd;  in jffs2_symlink()  local
379 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_symlink()
384 rd = jffs2_alloc_raw_dirent(); in jffs2_symlink()
385 if (!rd) { in jffs2_symlink()
395 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_symlink()
396 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_symlink()
397 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_symlink()
398 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_symlink()
400 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_symlink()
401 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_symlink()
402 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_symlink()
403 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_symlink()
404 rd->nsize = namelen; in jffs2_symlink()
405 rd->type = DT_LNK; in jffs2_symlink()
406 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_symlink()
407 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_symlink()
409 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_symlink()
415 jffs2_free_raw_dirent(rd); in jffs2_symlink()
421 dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); in jffs2_symlink()
423 jffs2_free_raw_dirent(rd); in jffs2_symlink()
447 struct jffs2_raw_dirent *rd; in jffs2_mkdir() local
522 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_mkdir()
527 rd = jffs2_alloc_raw_dirent(); in jffs2_mkdir()
528 if (!rd) { in jffs2_mkdir()
538 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_mkdir()
539 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_mkdir()
540 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_mkdir()
541 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_mkdir()
543 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_mkdir()
544 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_mkdir()
545 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_mkdir()
546 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_mkdir()
547 rd->nsize = namelen; in jffs2_mkdir()
548 rd->type = DT_DIR; in jffs2_mkdir()
549 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_mkdir()
550 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_mkdir()
552 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_mkdir()
558 jffs2_free_raw_dirent(rd); in jffs2_mkdir()
564 dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); in jffs2_mkdir()
567 jffs2_free_raw_dirent(rd); in jffs2_mkdir()
618 struct jffs2_raw_dirent *rd; in jffs2_mknod() local
695 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen, in jffs2_mknod()
700 rd = jffs2_alloc_raw_dirent(); in jffs2_mknod()
701 if (!rd) { in jffs2_mknod()
711 rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_mknod()
712 rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); in jffs2_mknod()
713 rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); in jffs2_mknod()
714 rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); in jffs2_mknod()
716 rd->pino = cpu_to_je32(dir_i->i_ino); in jffs2_mknod()
717 rd->version = cpu_to_je32(++dir_f->highest_version); in jffs2_mknod()
718 rd->ino = cpu_to_je32(inode->i_ino); in jffs2_mknod()
719 rd->mctime = cpu_to_je32(JFFS2_NOW()); in jffs2_mknod()
720 rd->nsize = namelen; in jffs2_mknod()
723 rd->type = (mode & S_IFMT) >> 12; in jffs2_mknod()
725 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); in jffs2_mknod()
726 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); in jffs2_mknod()
728 fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL); in jffs2_mknod()
734 jffs2_free_raw_dirent(rd); in jffs2_mknod()
740 dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); in jffs2_mknod()
742 jffs2_free_raw_dirent(rd); in jffs2_mknod()