/* trun_remove_range - apply a replay entry for a truncation to the TNC.  */
static int trun_remove_range(struct ubifs_info *c, struct replay_entry *r)
/* trun_remove_range - apply a replay entry for a truncation to the TNC.  */
static int trun_remove_range(struct ubifs_info *c, struct replay_entry *r)
{
	unsigned min_blk, max_blk;
	union ubifs_key min_key, max_key;
	ino_t ino;
	min_blk = r->new_size / UBIFS_BLOCK_SIZE;
	if (r->new_size & (UBIFS_BLOCK_SIZE - 1))
		min_blk += 1;
	max_blk = r->old_size / UBIFS_BLOCK_SIZE;
	if ((r->old_size & (UBIFS_BLOCK_SIZE - 1)) == 0)
		max_blk -= 1;
	ino = key_inum(c, &r->key);
	data_key_init(c, &min_key, ino, min_blk);
	data_key_init(c, &max_key, ino, max_blk);
	return ubifs_tnc_remove_range(c, &min_key, &max_key);
}