1BIO_ALLOC_BIOSET(9) The Linux VFS BIO_ALLOC_BIOSET(9)
2
3
4
6 bio_alloc_bioset - allocate a bio for I/O
7
9 struct bio * bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs,
10 struct bio_set * bs);
11
13 gfp_mask
14 the GFP_ mask given to the slab allocator
15
16 nr_iovecs
17 number of iovecs to pre-allocate
18
19 bs
20 the bio_set to allocate from. If NULL, just use kmalloc
21
23 bio_alloc_bioset will first try its own mempool to satisfy the
24 allocation. If __GFP_WAIT is set then we will block on the internal
25 pool waiting for a struct bio to become free. If a NULL bs is passed
26 in, we will fall back to just using kmalloc to allocate the required
27 memory.
28
29 Note that the caller must set ->bi_destructor on succesful return of a
30 bio, to do the appropriate freeing of the bio once the reference count
31 drops to zero.
32
34Kernel Hackers Manual 2.6. June 2019 BIO_ALLOC_BIOSET(9)