File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -435,20 +435,19 @@ bool bio_integrity_prep(struct bio *bio)
435
435
if (!bi )
436
436
return true;
437
437
438
- if (bio_op (bio ) != REQ_OP_READ && bio_op (bio ) != REQ_OP_WRITE )
439
- return true;
440
-
441
438
if (!bio_sectors (bio ))
442
439
return true;
443
440
444
441
/* Already protected? */
445
442
if (bio_integrity (bio ))
446
443
return true;
447
444
448
- if (bio_data_dir (bio ) == READ ) {
445
+ switch (bio_op (bio )) {
446
+ case REQ_OP_READ :
449
447
if (bi -> flags & BLK_INTEGRITY_NOVERIFY )
450
448
return true;
451
- } else {
449
+ break ;
450
+ case REQ_OP_WRITE :
452
451
if (bi -> flags & BLK_INTEGRITY_NOGENERATE )
453
452
return true;
454
453
@@ -459,6 +458,9 @@ bool bio_integrity_prep(struct bio *bio)
459
458
*/
460
459
if (bi -> csum_type == BLK_INTEGRITY_CSUM_NONE )
461
460
gfp |= __GFP_ZERO ;
461
+ break ;
462
+ default :
463
+ return true;
462
464
}
463
465
464
466
/* Allocate kernel buffer for protection data */
You can’t perform that action at this time.
0 commit comments