Skip to content

Commit 57fb233

Browse files
author
Kent Overstreet
committed
block: Reorder struct bio_set
This is prep work for the next patch, which embeds a struct bio_list in struct bio_set. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk>
1 parent a937536 commit 57fb233

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

‎include/linux/bio.h‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -298,39 +298,6 @@ static inline int bio_associate_current(struct bio *bio) { return -ENOENT; }
298298
static inline void bio_disassociate_task(struct bio *bio) { }
299299
#endif /* CONFIG_BLK_CGROUP */
300300

301-
/*
302-
* bio_set is used to allow other portions of the IO system to
303-
* allocate their own private memory pools for bio and iovec structures.
304-
* These memory pools in turn all allocate from the bio_slab
305-
* and the bvec_slabs[].
306-
*/
307-
#define BIO_POOL_SIZE 2
308-
#define BIOVEC_NR_POOLS 6
309-
#define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1)
310-
311-
struct bio_set {
312-
struct kmem_cache *bio_slab;
313-
unsigned int front_pad;
314-
315-
mempool_t *bio_pool;
316-
#if defined(CONFIG_BLK_DEV_INTEGRITY)
317-
mempool_t *bio_integrity_pool;
318-
#endif
319-
mempool_t *bvec_pool;
320-
};
321-
322-
struct biovec_slab {
323-
int nr_vecs;
324-
char *name;
325-
struct kmem_cache *slab;
326-
};
327-
328-
/*
329-
* a small number of entries is fine, not going to be performance critical.
330-
* basically we just need to survive
331-
*/
332-
#define BIO_SPLIT_ENTRIES 2
333-
334301
#ifdef CONFIG_HIGHMEM
335302
/*
336303
* remember never ever reenable interrupts between a bvec_kmap_irq and
@@ -527,6 +494,39 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
527494
return bio;
528495
}
529496

497+
/*
498+
* bio_set is used to allow other portions of the IO system to
499+
* allocate their own private memory pools for bio and iovec structures.
500+
* These memory pools in turn all allocate from the bio_slab
501+
* and the bvec_slabs[].
502+
*/
503+
#define BIO_POOL_SIZE 2
504+
#define BIOVEC_NR_POOLS 6
505+
#define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1)
506+
507+
struct bio_set {
508+
struct kmem_cache *bio_slab;
509+
unsigned int front_pad;
510+
511+
mempool_t *bio_pool;
512+
#if defined(CONFIG_BLK_DEV_INTEGRITY)
513+
mempool_t *bio_integrity_pool;
514+
#endif
515+
mempool_t *bvec_pool;
516+
};
517+
518+
struct biovec_slab {
519+
int nr_vecs;
520+
char *name;
521+
struct kmem_cache *slab;
522+
};
523+
524+
/*
525+
* a small number of entries is fine, not going to be performance critical.
526+
* basically we just need to survive
527+
*/
528+
#define BIO_SPLIT_ENTRIES 2
529+
530530
#if defined(CONFIG_BLK_DEV_INTEGRITY)
531531

532532
#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))

0 commit comments

Comments
 (0)