@@ -141,11 +141,6 @@ struct dm_snapshot {
141
141
* for them to be committed.
142
142
*/
143
143
struct bio_list bios_queued_during_merge ;
144
-
145
- /*
146
- * Flush data after merge.
147
- */
148
- struct bio flush_bio ;
149
144
};
150
145
151
146
/*
@@ -1127,17 +1122,6 @@ static void snapshot_merge_next_chunks(struct dm_snapshot *s)
1127
1122
1128
1123
static void error_bios (struct bio * bio );
1129
1124
1130
- static int flush_data (struct dm_snapshot * s )
1131
- {
1132
- struct bio * flush_bio = & s -> flush_bio ;
1133
-
1134
- bio_reset (flush_bio );
1135
- bio_set_dev (flush_bio , s -> origin -> bdev );
1136
- flush_bio -> bi_opf = REQ_OP_WRITE | REQ_PREFLUSH ;
1137
-
1138
- return submit_bio_wait (flush_bio );
1139
- }
1140
-
1141
1125
static void merge_callback (int read_err , unsigned long write_err , void * context )
1142
1126
{
1143
1127
struct dm_snapshot * s = context ;
@@ -1151,7 +1135,7 @@ static void merge_callback(int read_err, unsigned long write_err, void *context)
1151
1135
goto shut ;
1152
1136
}
1153
1137
1154
- if (flush_data ( s ) < 0 ) {
1138
+ if (blkdev_issue_flush ( s -> origin -> bdev ) < 0 ) {
1155
1139
DMERR ("Flush after merge failed: shutting down merge" );
1156
1140
goto shut ;
1157
1141
}
@@ -1340,7 +1324,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1340
1324
s -> first_merging_chunk = 0 ;
1341
1325
s -> num_merging_chunks = 0 ;
1342
1326
bio_list_init (& s -> bios_queued_during_merge );
1343
- bio_init (& s -> flush_bio , NULL , 0 );
1344
1327
1345
1328
/* Allocate hash table for COW data */
1346
1329
if (init_hash_tables (s )) {
@@ -1528,8 +1511,6 @@ static void snapshot_dtr(struct dm_target *ti)
1528
1511
1529
1512
dm_exception_store_destroy (s -> store );
1530
1513
1531
- bio_uninit (& s -> flush_bio );
1532
-
1533
1514
dm_put_device (ti , s -> cow );
1534
1515
1535
1516
dm_put_device (ti , s -> origin );
0 commit comments