[PATCH 2/5] block: Consolidate static integrity profile properties
Dan Williams
dan.j.williams at intel.com
Tue Oct 13 18:11:50 PDT 2015
On Mon, Oct 12, 2015 at 2:05 PM, Martin K. Petersen
<martin.petersen at oracle.com> wrote:
> We previously made a complete copy of a device's data integrity profile
> even though several of the fields inside the blk_integrity struct are
> pointers to fixed template entries in t10-pi.c.
>
> Split the static and per-device portions so that we can reference the
> template directly.
>
> Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
> Reported-by: Christoph Hellwig <hch at lst.de>
> Reviewed-by: Sagi Grimberg <sagig at mellanox.com>
> Cc: Dan Williams <dan.j.williams at intel.com>
[..]
> diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c
> index cb62ec6a12d0..9e1b0f656a9b 100644
> --- a/drivers/nvdimm/core.c
> +++ b/drivers/nvdimm/core.c
> @@ -399,19 +399,22 @@ static int nd_pi_nop_generate_verify(struct blk_integrity_iter *iter)
>
> int nd_integrity_init(struct gendisk *disk, unsigned long meta_size)
> {
> - struct blk_integrity integrity = {
> + struct blk_integrity bi;
> + struct blk_integrity_profile profile = {
> .name = "ND-PI-NOP",
> .generate_fn = nd_pi_nop_generate_verify,
> .verify_fn = nd_pi_nop_generate_verify,
> - .tuple_size = meta_size,
> - .tag_size = meta_size,
'profile' here needs to be made static since we reference rather than
copy the profile data at blk_integrity_register() time. This is part
of, but I don't think all of, my blk_integrity shutdown woes.
More information about the Linux-nvme
mailing list