diff options
| author | Max Gurtovoy <maxg@mellanox.com> | 2019-09-16 11:44:29 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-09-17 22:03:49 -0400 |
| commit | 54d4e6ab91eb24b47a58403d8561206e916f0242 (patch) | |
| tree | 3bd64c92b614284071d893012abcf01bfc55cabc /include/linux/blkdev.h | |
| parent | 5eaed68dd38c14907be2ce5a45c73a5f2acb75f4 (diff) | |
block: centralize PI remapping logic to the block layer
Currently t10_pi_prepare/t10_pi_complete functions are called during the
NVMe and SCSi layers command preparetion/completion, but their actual
place should be the block layer since T10-PI is a general data integrity
feature that is used by block storage protocols. Introduce .prepare_fn
and .complete_fn callbacks within the integrity profile that each type
can implement according to its needs.
Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Suggested-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Fixed to not call queue integrity functions if BLK_DEV_INTEGRITY
isn't defined in the config.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3094f2d513b2..6032bb740cf4 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -1522,10 +1522,14 @@ struct blk_integrity_iter { | |||
| 1522 | }; | 1522 | }; |
| 1523 | 1523 | ||
| 1524 | typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *); | 1524 | typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *); |
| 1525 | typedef void (integrity_prepare_fn) (struct request *); | ||
| 1526 | typedef void (integrity_complete_fn) (struct request *, unsigned int); | ||
| 1525 | 1527 | ||
| 1526 | struct blk_integrity_profile { | 1528 | struct blk_integrity_profile { |
| 1527 | integrity_processing_fn *generate_fn; | 1529 | integrity_processing_fn *generate_fn; |
| 1528 | integrity_processing_fn *verify_fn; | 1530 | integrity_processing_fn *verify_fn; |
| 1531 | integrity_prepare_fn *prepare_fn; | ||
| 1532 | integrity_complete_fn *complete_fn; | ||
| 1529 | const char *name; | 1533 | const char *name; |
| 1530 | }; | 1534 | }; |
| 1531 | 1535 | ||
