]> 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>
Tue, 25 Sep 2012 00:31:01 +0000 (10:31 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Sep 2012 00:33:47 +0000 (10:33 +1000)
commit8c05ce49d40e9faedd5285b43749714a68ba363b
tree638afe586f3b2e54f1cb814e2fc3827b7507dbd3
parent21b15259660f084f72961508d83eda07ecc96b39
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