]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/bio.c
block: Convert integrity to bvec_alloc_bs()
authorKent Overstreet <koverstreet@google.com>
Fri, 12 Oct 2012 22:29:33 +0000 (15:29 -0700)
committerKent Overstreet <koverstreet@google.com>
Sat, 23 Mar 2013 21:15:27 +0000 (14:15 -0700)
commit9f060e2231ca96ca94f2ffcff730acd72606b280
tree4818da8b59010493810e04d7a6273707875dc73c
parent6fda981cafbf908acd11e1e636fec50e99d56a47
block: Convert integrity to bvec_alloc_bs()

This adds a pointer to the bvec array to struct bio_integrity_payload,
instead of the bvecs always being inline; then the bvecs are allocated
with bvec_alloc_bs().

Changed bvec_alloc_bs() and bvec_free_bs() to take a pointer to a
mempool instead of the bioset, so that bio integrity can use a different
mempool for its bvecs, and thus avoid a potential deadlock.

This is eventually for immutable bio vecs - immutable bvecs aren't
useful if we still have to copy them, hence the need for the pointer.
Less code is always nice too, though.

Also, bio_integrity_alloc() was using fs_bio_set if no bio_set was
specified. This was wrong - using the bio_set doesn't protect us from
memory allocation failures, because we just used kmalloc for the
bio_integrity_payload. But it does introduce the possibility of
deadlock, if for some reason we weren't supposed to be using fs_bio_set.

Signed-off-by: Kent Overstreet <koverstreet@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: Martin K. Petersen <martin.petersen@oracle.com>
fs/bio-integrity.c
fs/bio.c
include/linux/bio.h