Re: [PATCH v6 02/11] block: Block Device Filtering Mechanism

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	struct request_queue *q = bdev_get_queue(bio->bi_bdev);
> +	bool skip_bio = false;
> +
> +	if (unlikely(bio_queue_enter(bio)))
> +		return;
> +
> +	if (bio->bi_bdev->bd_filter &&
> +	    bio->bi_bdev->bd_filter != current->blk_filter) {
> +		struct blkfilter *prev = current->blk_filter;
> +
> +		current->blk_filter = bio->bi_bdev->bd_filter;
> +		skip_bio = bio->bi_bdev->bd_filter->ops->submit_bio(bio);
> +		current->blk_filter = prev;
> +	}
> +
> +	blk_queue_exit(q);

This currently adds a queue enter/exit pair even if no filter driver
is used, which іs probably not acceptable.  We probably need some
way to avoid the check in the fast path.  In general an unlocked check
for bio->bi_bdev->bd_filter outside the protection seems fine to here,
we just need to find a good way to make sure it is visible by the
time a filter is actually set and the filter driver initialization.

>  	if (!bio->bi_bdev->bd_has_submit_bio) {
>  		blk_mq_submit_bio(bio);
> -	} else if (likely(bio_queue_enter(bio) == 0)) {
> +		return;
> +	}
> +
> +	if (likely(bio_queue_enter(bio) == 0)) {

This is just stray reformatting and we can drop it.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux