/* Move count entries from end of map between two memory locations. Returns pointer to last entry moved.  */
static struct ext3_dir_entry_2 * dx_move_dirents(char *from, char *to, struct dx_map_entry *offsets, int count)
/* Move count entries from end of map between two memory locations. Returns pointer to last entry moved.  */
static struct ext3_dir_entry_2 * dx_move_dirents(char *from, char *to, struct dx_map_entry *offsets, int count)
{
	unsigned rec_len = 0;
	while (count--) {
		struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs);
		rec_len = EXT3_DIR_REC_LEN(de->name_len);
		memcpy (to, de, rec_len);
		((struct ext3_dir_entry_2 *) to)->rec_len =
				ext3_rec_len_to_disk(rec_len);
		de->inode = 0;
		map++;
		to += rec_len;
	}
	return (struct ext3_dir_entry_2 *) (to - rec_len);
}