]> 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, 18 Sep 2012 23:38:21 +0000 (09:38 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 18 Sep 2012 23:42:02 +0000 (09:42 +1000)
commite56559b16752c34dcec61f543a0fe628aa13e123
tree5882f36d77023cf3a5d647729eb5fd711d8512ea
parent267489b166ca20683b37e501337f5e5b615e8ddb
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