/* Set empty cluster from 'entry' to the end of a file  */
static int clear_fatent(fsdata *mydata, __u32 entry)
/* Set empty cluster from 'entry' to the end of a file  */
static int clear_fatent(fsdata *mydata, __u32 entry)
{
	__u32 fat_val;
	while (!CHECK_CLUST(entry, mydata->fatsize)) {
		fat_val = get_fatent(mydata, entry);
		if (fat_val != 0)
			set_fatent_value(mydata, entry, 0);
		else
			break;
		entry = fat_val;
	}
	if (flush_dirty_fat_buffer(mydata) < 0)
		return -1;
	return 0;
}