On Thu, Feb 06, 2020 at 08:20:16AM +0000, Johannes Thumshirn wrote: > >> op_flags = REQ_SYNC | REQ_META | REQ_PRIO; > >> if (i == 0 && !btrfs_test_opt(device->fs_info, NOBARRIER)) > >> op_flags |= REQ_FUA; > > > >> + bio->bi_opf = REQ_OP_WRITE | op_flags; > > > > You could kill the op_flags variable and just assign everything directly > > to bio->bi_opf. > > > > Then I'd still have to deal with the NOBARRIER mount option here so > op_flags is nice to have for readability. I tend to disagree. The simple version is: bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO; if (i == 0 && !btrfs_test_opt(device->fs_info, NOBARRIER)) bio->bi_opf |= REQ_FUA;
