]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm io: remove extra bi_io_vec region hack
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 10 Dec 2009 23:51:58 +0000 (23:51 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 10 Dec 2009 23:51:58 +0000 (23:51 +0000)
commitf1e539874655ae9e74c1644fd54133b19f1b14e2
tree72dd2956c3915a45984321c192964ce7a88dbe07
parent952b355760c196ec014dd0b6878f85a11496e3da
dm io: remove extra bi_io_vec region hack

Remove the hack where we allocate an extra bi_io_vec to store additional
private data.  This hack prevents us from supporting barriers in
dm-raid1 without first making another little block layer change.
Instead of doing that, this patch eliminates the bi_io_vec abuse by
storing the region number directly in the low bits of bi_private.

We need to store two things for each bio, the pointer to the main io
structure and, if parallel writes were requested, an index indicating
which of these writes this bio belongs to.  There can be at most
BITS_PER_LONG regions - 32 or 64.

The index (region number) was stored in the last (hidden) bio vector and
the pointer to struct io was stored in bi_private.

This patch now aligns "struct io" on BITS_PER_LONG bytes and stores the
region number in the low BITS_PER_LONG bits of bi_private.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-io.c