Re: [PATCH v2] Btrfs: remove unneeded allocation inload_free_space_cache()

From: Josef Bacik
Date: Wed Jan 19 2011 - 13:51:32 EST


On Wed, Jan 19, 2011 at 06:58:37PM +0200, Ilya Dryomov wrote:
> I messed up size argument of kzalloc() and consequently memcpy(). Here
> is an updated version.
>
>
> The checksums array is unused, remove it. We only need disk_crcs array
> to verify checksums.
>
> There is no need to allocate first_page_offset bytes for disk_crcs
> array. It's enough to allocate (sizeof(u32) * num_checksums) bytes
> because disk_crcs should only hold checksums. gen is fetched
> directly from the page.
>
> cur_crc is initialized later in the code. Don't initialize it in a
> declaration.
>
> Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx>

Reviewed-by: Josef Bacik <josef@xxxxxxxxxx>

Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/