@@ -226,16 +226,16 @@ static void do_metadata(struct work_struct *work)
226
226
/*
227
227
* Read or write a chunk aligned and sized block of data from a device.
228
228
*/
229
- static int chunk_io (struct pstore * ps , void * area , chunk_t chunk , int op ,
230
- int op_flags , int metadata )
229
+ static int chunk_io (struct pstore * ps , void * area , chunk_t chunk , blk_opf_t opf ,
230
+ int metadata )
231
231
{
232
232
struct dm_io_region where = {
233
233
.bdev = dm_snap_cow (ps -> store -> snap )-> bdev ,
234
234
.sector = ps -> store -> chunk_size * chunk ,
235
235
.count = ps -> store -> chunk_size ,
236
236
};
237
237
struct dm_io_request io_req = {
238
- .bi_opf = op | op_flags ,
238
+ .bi_opf = opf ,
239
239
.mem .type = DM_IO_VMA ,
240
240
.mem .ptr .vma = area ,
241
241
.client = ps -> io_client ,
@@ -281,11 +281,11 @@ static void skip_metadata(struct pstore *ps)
281
281
* Read or write a metadata area. Remembering to skip the first
282
282
* chunk which holds the header.
283
283
*/
284
- static int area_io (struct pstore * ps , int op , int op_flags )
284
+ static int area_io (struct pstore * ps , blk_opf_t opf )
285
285
{
286
286
chunk_t chunk = area_location (ps , ps -> current_area );
287
287
288
- return chunk_io (ps , ps -> area , chunk , op , op_flags , 0 );
288
+ return chunk_io (ps , ps -> area , chunk , opf , 0 );
289
289
}
290
290
291
291
static void zero_memory_area (struct pstore * ps )
@@ -296,7 +296,7 @@ static void zero_memory_area(struct pstore *ps)
296
296
static int zero_disk_area (struct pstore * ps , chunk_t area )
297
297
{
298
298
return chunk_io (ps , ps -> zero_area , area_location (ps , area ),
299
- REQ_OP_WRITE , 0 , 0 );
299
+ REQ_OP_WRITE , 0 );
300
300
}
301
301
302
302
static int read_header (struct pstore * ps , int * new_snapshot )
@@ -328,7 +328,7 @@ static int read_header(struct pstore *ps, int *new_snapshot)
328
328
if (r )
329
329
return r ;
330
330
331
- r = chunk_io (ps , ps -> header_area , 0 , REQ_OP_READ , 0 , 1 );
331
+ r = chunk_io (ps , ps -> header_area , 0 , REQ_OP_READ , 1 );
332
332
if (r )
333
333
goto bad ;
334
334
@@ -389,7 +389,7 @@ static int write_header(struct pstore *ps)
389
389
dh -> version = cpu_to_le32 (ps -> version );
390
390
dh -> chunk_size = cpu_to_le32 (ps -> store -> chunk_size );
391
391
392
- return chunk_io (ps , ps -> header_area , 0 , REQ_OP_WRITE , 0 , 1 );
392
+ return chunk_io (ps , ps -> header_area , 0 , REQ_OP_WRITE , 1 );
393
393
}
394
394
395
395
/*
@@ -733,8 +733,8 @@ static void persistent_commit_exception(struct dm_exception_store *store,
733
733
/*
734
734
* Commit exceptions to disk.
735
735
*/
736
- if (ps -> valid && area_io (ps , REQ_OP_WRITE ,
737
- REQ_PREFLUSH | REQ_FUA | REQ_SYNC ))
736
+ if (ps -> valid && area_io (ps , REQ_OP_WRITE | REQ_PREFLUSH | REQ_FUA |
737
+ REQ_SYNC ))
738
738
ps -> valid = 0 ;
739
739
740
740
/*
@@ -774,7 +774,7 @@ static int persistent_prepare_merge(struct dm_exception_store *store,
774
774
return 0 ;
775
775
776
776
ps -> current_area -- ;
777
- r = area_io (ps , REQ_OP_READ , 0 );
777
+ r = area_io (ps , REQ_OP_READ );
778
778
if (r < 0 )
779
779
return r ;
780
780
ps -> current_committed = ps -> exceptions_per_area ;
@@ -811,7 +811,7 @@ static int persistent_commit_merge(struct dm_exception_store *store,
811
811
for (i = 0 ; i < nr_merged ; i ++ )
812
812
clear_exception (ps , ps -> current_committed - 1 - i );
813
813
814
- r = area_io (ps , REQ_OP_WRITE , REQ_PREFLUSH | REQ_FUA );
814
+ r = area_io (ps , REQ_OP_WRITE | REQ_PREFLUSH | REQ_FUA );
815
815
if (r < 0 )
816
816
return r ;
817
817
0 commit comments