Lines Matching refs:de
569 struct ext2_direntry *de; in find_dir_entry() local
583 de = ext2_fetch_direntry(disk_de); in find_dir_entry()
584 if (de == NULL) { in find_dir_entry()
588 if (len == de->de_name_len && strncmp(de->de_name, name, len) == 0) { in find_dir_entry()
589 ino = de->de_inode; in find_dir_entry()
597 offset += de->de_rec_len; in find_dir_entry()
598 k_heap_free(&direntry_heap, de); in find_dir_entry()
603 k_heap_free(&direntry_heap, de); in find_dir_entry()
826 struct ext2_direntry *de = ext2_fetch_direntry(disk_de); in ext2_get_direntry() local
828 if (de == NULL) { in ext2_get_direntry()
833 LOG_DBG("inode=%d name_len=%d rec_len=%d", de->de_inode, de->de_name_len, de->de_rec_len); in ext2_get_direntry()
835 len = de->de_name_len; in ext2_get_direntry()
836 if (de->de_name_len > MAX_FILE_NAME) { in ext2_get_direntry()
840 memcpy(ent->name, de->de_name, len); in ext2_get_direntry()
843 LOG_DBG("name_len=%d name=%s %d", de->de_name_len, ent->name, EXT2_MAX_FILE_NAME); in ext2_get_direntry()
846 ent->type = de->de_file_type & EXT2_FT_DIR ? FS_DIR_ENTRY_DIR : FS_DIR_ENTRY_FILE; in ext2_get_direntry()
852 rc = ext2_inode_get(fs, de->de_inode, &inode); in ext2_get_direntry()
863 dir->f_off += de->de_rec_len; in ext2_get_direntry()
866 k_heap_free(&direntry_heap, de); in ext2_get_direntry()
914 struct ext2_direntry *de = k_heap_alloc(&direntry_heap, prog_rec_len, K_FOREVER); in ext2_create_direntry() local
922 de->de_inode = ino; in ext2_create_direntry()
923 de->de_rec_len = reclen; in ext2_create_direntry()
924 de->de_name_len = (uint8_t)namelen; in ext2_create_direntry()
925 de->de_file_type = filetype; in ext2_create_direntry()
926 memcpy(de->de_name, name, namelen); in ext2_create_direntry()
929 de, de->de_name, de->de_name_len, de->de_inode, de->de_rec_len, in ext2_create_direntry()
930 de->de_file_type == EXT2_FT_DIR ? 'd' : 'f'); in ext2_create_direntry()
931 return de; in ext2_create_direntry()
959 struct ext2_disk_direntry *de = 0; in ext2_add_direntry() local
963 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(dir), offset); in ext2_add_direntry()
964 reclen = ext2_get_disk_direntry_reclen(de); in ext2_add_direntry()
972 uint32_t occupied = sizeof(struct ext2_disk_direntry) + ext2_get_disk_direntry_namelen(de); in ext2_add_direntry()
983 ext2_set_disk_direntry_reclen(de, occupied); in ext2_add_direntry()
1014 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(dir), offset); in ext2_add_direntry()
1015 ext2_write_direntry(de, entry); in ext2_add_direntry()
1154 struct ext2_disk_direntry *de = in ext2_del_direntry() local
1156 uint16_t reclen = ext2_get_disk_direntry_reclen(de); in ext2_del_direntry()
1186 memmove(de, next, next_reclen); in ext2_del_direntry()
1187 ext2_set_disk_direntry_reclen(de, reclen + next_reclen); in ext2_del_direntry()
1200 struct ext2_disk_direntry *de = in ext2_del_direntry() local
1203 reclen = ext2_get_disk_direntry_reclen(de); in ext2_del_direntry()
1207 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(parent), cur); in ext2_del_direntry()
1208 reclen = ext2_get_disk_direntry_reclen(de); in ext2_del_direntry()
1215 ext2_set_disk_direntry_reclen(de, reclen + del_reclen); in ext2_del_direntry()
1258 struct ext2_disk_direntry *de; in can_unlink() local
1261 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(inode), 0); in can_unlink()
1262 offset += ext2_get_disk_direntry_reclen(de); in can_unlink()
1265 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(inode), offset); in can_unlink()
1266 offset += ext2_get_disk_direntry_reclen(de); in can_unlink()
1317 struct ext2_disk_direntry *de; in ext2_replace_file() local
1329 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(args_from->parent), from_blk_off); in ext2_replace_file()
1332 uint8_t file_type = ext2_get_disk_direntry_type(de); in ext2_replace_file()
1339 ext2_set_disk_direntry_inode(de, args_to->inode->i_id); in ext2_replace_file()
1343 ext2_set_disk_direntry_inode(de, args_from->inode->i_id); in ext2_replace_file()
1356 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(args_to->parent), to_blk_off); in ext2_replace_file()
1359 ext2_set_disk_direntry_inode(de, args_from->inode->i_id); in ext2_replace_file()
1360 ext2_set_disk_direntry_type(de, file_type); in ext2_replace_file()
1387 struct ext2_disk_direntry *de; in ext2_move_file() local
1389 de = EXT2_DISK_DIRENTRY_BY_OFFSET(inode_current_block_mem(fparent), blk_off); in ext2_move_file()
1391 uint16_t reclen = ext2_get_disk_direntry_reclen(de); in ext2_move_file()
1396 ext2_set_disk_direntry_namelen(de, args_to->name_len); in ext2_move_file()
1397 ext2_set_disk_direntry_name(de, args_to->path + args_to->name_pos, in ext2_move_file()