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