Re: [PATCH V8 08/11] block: add blk_end_flush_machinery

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

 



On Sat, Apr 25, 2020 at 11:44:05AM +0800, Ming Lei wrote:
> > FYI, we don't really need the bdev to send a bio anymore, this could just
> > do:
> > 
> > 	bio = bio_alloc(GFP_KERNEL, 0); // XXX: shouldn't this be GFP_NOIO??
> 
> Error handling.

bio_alloc does not fail for allocations that can sleep.

> 
> > 	bio->bi_disk = rq->rq_disk;
> > 	bio->bi_partno = 0;
> > 	bio_associate_blkg(bio); // XXX: actually, shouldn't this come from rq?
> > 	bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
> > 	error = submit_bio_wait(bio);
> > 	bio_put(bio);
> 
> Yeah, that is another way, however I prefer to blkdev_issue_flush
> because it takes less code and we do have the API of blkdev_issue_flush.

It is about the same amount of code, and as commented above I think the
current code uses the wrong blkg assignment.



[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