]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Use the recently-added bio front_pad field to allocate struct dm_target_io.
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 8 Oct 2012 23:01:34 +0000 (10:01 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 8 Oct 2012 23:02:35 +0000 (10:02 +1100)
commit24d047be6c65a5a89bd9ab60d92d8dfe40389e7c
tree34a0e51fcaa20e5156e177b823d914b899994ce3
parentef0095375b3500875bd24333bab3fe38ebab16ac
Use the recently-added bio front_pad field to allocate struct dm_target_io.

Prior to this patch, dm_target_io was allocated from a mempool. For each
dm_target_io, there is exactly one bio allocated from a bioset.

This patch merges these two allocations into one allocation: we create a
bioset with front_pad equal to the size of dm_target_io so that every
bio allocated from the bioset has sizeof(struct dm_target_io) bytes
before it. We allocate a bio and use the bytes before the bio as
dm_target_io.

This idea was introduced by Kent Overstreet.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: tj@kernel.org
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm.c