Re: [PATCH 3/4] ext4: Add batched discard support for ext4

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lukas Czerner
Date: Tuesday, October 26, 2010 - 5:43 am

On Mon, 25 Oct 2010, Ted Ts'o wrote:


Right, it should be. Sorry about that.


I am ashamed, I probably should test patches on different architectures.
Thanks.


If the group is NOT last group, or (start+len) is aligned to the
EXT4_BLOCK_PER_GROUP() boundary we will trim all blocks in this
particular block group. Otherwise we will know how much we need to trim
in this group to satisfy user request

	if (len >= EXT4_BLOCKS_PER_GROUP(sb))
		len -= (EXT4_BLOCKS_PER_GROUP(sb) - first_block);
	else
		last_block = len;

because we do keep track of how many block we need to trim by
decreasing len.


This is not a problem, because when traversing the bitmap we will hit
the end of the group anyway, because those blocks (out of filesystem) are
marked as used in the bitmap and hence:

	start = mb_find_next_zero_bit(bitmap, max, start);
		if (start >= max)
			break;

will end the traversing without any attempt to trim blocks out of
filesystem boundary.


-Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4 v. 9] Ext3/Ext4 Batched discard support, Lukas Czerner, (Mon Sep 27, 7:09 am)
[PATCH 2/4] Add ioctl FITRIM., Lukas Czerner, (Mon Sep 27, 7:09 am)
[PATCH 3/4] ext4: Add batched discard support for ext4, Lukas Czerner, (Mon Sep 27, 7:09 am)
[PATCH 4/4] ext3: Add batched discard support for ext3, Lukas Czerner, (Mon Sep 27, 7:10 am)
Re: [PATCH 0/4 v. 9] Ext3/Ext4 Batched discard support, Lukas Czerner, (Mon Oct 11, 10:02 am)
Fstrim tool, Lukas Czerner, (Mon Oct 25, 9:06 am)
Re: [PATCH 3/4] ext4: Add batched discard support for ext4, Lukas Czerner, (Tue Oct 26, 5:43 am)