}
}
- bio_set_op_attrs(bio, REQ_OP_WRITE, WRITE_FLUSH);
+ static int __submit_flush_wait(struct block_device *bdev)
+ {
+ struct bio *bio = f2fs_bio_alloc(0);
+ int ret;
+
++ bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
+ bio->bi_bdev = bdev;
+ ret = submit_bio_wait(bio);
+ bio_put(bio);
+ return ret;
+ }
+
+ static int submit_flush_wait(struct f2fs_sb_info *sbi)
+ {
+ int ret = __submit_flush_wait(sbi->sb->s_bdev);
+ int i;
+
+ if (sbi->s_ndevs && !ret) {
+ for (i = 1; i < sbi->s_ndevs; i++) {
+ ret = __submit_flush_wait(FDEV(i).bdev);
+ if (ret)
+ break;
+ }
+ }
+ return ret;
+ }
+
static int issue_flush_thread(void *data)
{
struct f2fs_sb_info *sbi = data;