1BIO_ALLOC(9) The Linux VFS BIO_ALLOC(9)
2
3
4
6 bio_alloc - allocate a new bio, memory pool backed
7
9 struct bio * bio_alloc(gfp_t gfp_mask, int nr_iovecs);
10
12 gfp_mask
13 allocation mask to use
14
15 nr_iovecs
16 number of iovecs
17
19 bio_alloc will allocate a bio and associated bio_vec array that can
20 hold at least nr_iovecs entries. Allocations will be done from the
21 fs_bio_set. Also see bio_alloc_bioset and bio_kmalloc.
22
23 If __GFP_WAIT is set, then bio_alloc will always be able to allocate a
24 bio. This is due to the mempool guarantees. To make this work, callers
25 must never allocate more than 1 bio at a time from this pool. Callers
26 that need to allocate more than 1 bio must always submit the previously
27 allocated bio for IO before attempting to allocate a new one. Failure
28 to do so can cause livelocks under memory pressure.
29
31 Pointer to new bio on success, NULL on failure.
32
34Kernel Hackers Manual 2.6. November 2011 BIO_ALLOC(9)