On 2/18/25 19:21, Christoph Hellwig wrote:
Many of the fields in struct bio_integrity_data are only needed for the default integrity buffer in the block layer, and the variable sized array at the end of the structure makes it very hard to embed into caller allocated structures. Reduce struct bio_integrity_data to the minimal structure needed in common code, and create containing structures for the payload + bvec allocation for submitter provided buffers, and the default integrity code. Stop using mempools for the submitter buffers as they don't sit below the I/O stack, and instead always use the mempool for automatic integrity metadata instead of depending on bio_set that is submitter controlled and thus often doesn't have the mempool initialized. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> --- block/bio-integrity-auto.c | 75 +++++++++++++------ block/bio-integrity.c | 107 ++++++---------------------- block/bio.c | 6 -- block/blk.h | 2 +- block/t10-pi.c | 6 +- drivers/md/dm-integrity.c | 12 ---- drivers/md/dm-table.c | 6 -- drivers/md/md.c | 13 ---- drivers/target/target_core_iblock.c | 12 ---- include/linux/bio-integrity.h | 25 +------ include/linux/bio.h | 4 -- 11 files changed, 80 insertions(+), 188 deletions(-)
Reviewed-by: Hannes Reinecke <hare@xxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich