On Fri, Feb 14, 2020 at 12:24:33AM +0900, Johannes Thumshirn wrote: > + /* > + * Directly use BIOs here instead of relying on the page-cache > + * to do I/O, so we don't loose the ability to do integrity > + * checking. > + */ > + bio = bio_alloc(GFP_NOFS, 1); > + bio_set_dev(bio, device->bdev); > + bio->bi_iter.bi_sector = bytenr >> SECTOR_SHIFT; > + bio->bi_private = device; > + bio->bi_end_io = btrfs_end_super_write; As a potential future cleanup and simplification, the per-device flush bio can be used here and not a new one allocated. The flush bios are sent synchronously and are free for later use by the async submit writes.
