Re: [PATCH v6 2/4] block: add blk_interposer

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 07:53:13AM +0300, Sergei Shtepa wrote: > > Please avoid the overly long line. > > > > > + int ret = 0; > > > + > > > + if (WARN_ON(!interposer)) > > > > WARN_ON_ONCE? > > This function should be called quite rarely, and the absence of the interposer > parameter indicates

Re: [PATCH v6 2/4] block: add blk_interposer

2021-03-09 Thread Sergei Shtepa
Thank you, Christoph, for the review. I will correct all except two points. The 03/09/2021 20:27, Christoph Hellwig wrote: > > +static blk_qc_t __submit_bio_interposed(struct bio *bio) > > +{ > > + struct bio_list bio_list[2] = { }; > > + blk_qc_t ret = BLK_QC_T_NONE; > > + > > +

Re: [PATCH v6 2/4] block: add blk_interposer

2021-03-09 Thread Christoph Hellwig
> +static blk_qc_t __submit_bio_interposed(struct bio *bio) > +{ > + struct bio_list bio_list[2] = { }; > + blk_qc_t ret = BLK_QC_T_NONE; > + > + current->bio_list = bio_list; > + if (likely(bio_queue_enter(bio) == 0)) { > + struct block_device *bdev = bio->bi_bdev; > +

[PATCH v6 2/4] block: add blk_interposer

2021-03-03 Thread Sergei Shtepa
blk_interposer allows to intercept bio requests, remap bio to another devices or add new bios. Signed-off-by: Sergei Shtepa --- block/bio.c | 2 + block/blk-core.c | 36 +++ block/genhd.c | 93 +++