nvidia: vblk: fix compilation error

in linux below patches remove the support for QUEUE_FLAG_DISCARD
and QUEUE_FLAG_SECERASE.
commit 70200574cc229f6ba038259e8142af2aa09e6976
Author: Christoph Hellwig <hch@lst.de>
Date:   Fri Apr 15 06:52:55 2022 +0200

    block: remove QUEUE_FLAG_DISCARD

    Just use a non-zero max_discard_sectors as an indicator for discard
    support, similar to what is done for write zeroes.

    The only places where needs special attention is the RAID5 driver,
    which must clear discard support for security reasons by default,
    even if the default stacking rules would allow for it.

commit 44abff2c0b970ae3d310b97617525dc01f248d7c
Author: Christoph Hellwig <hch@lst.de>
Date:   Fri Apr 15 06:52:57 2022 +0200

    block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

    Secure erase is a very different operation from discard in that it is
    a data integrity operation vs hint.  Fully split the limits and helper
    infrastructure to make the separation more clear.

we are fixing below compilation error using this patch.
nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:921:22:
error: ‘QUEUE_FLAG_DISCARD’ undeclared (first use in this function);
did you mean ‘QUEUE_FLAG_DEAD’?
  921 |   blk_queue_flag_set(QUEUE_FLAG_DISCARD, vblkdev->queue);
      |                      ^~~~~~~~~~~~~~~~~~
      |                      QUEUE_FLAG_DEAD
nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:921:22:
note: each undeclared identifier is reported only once for each function
it appears in nvidia-oot/drivers/block/tegra_virt_storage/tegra_hv_vblk.c:928:23:
error: ‘QUEUE_FLAG_SECERASE’ undeclared (first use in this function);
did you mean ‘QUEUE_FLAG_NOMERGES’?
  928 |    blk_queue_flag_set(QUEUE_FLAG_SECERASE, vblkdev->queue);

Bug 3733730

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I47ad13be833fdd7ec7f0d2127699e28311fbeb83
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2784741
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Manish Bhardwaj
2022-09-30 10:47:02 +05:30
committed by mobile promotions
parent 272be41c99
commit f7b80313df

View File

@@ -918,14 +918,18 @@ static void setup_device(struct vblk_dev *vblkdev)
if (vblkdev->config.blk_config.req_ops_supported if (vblkdev->config.blk_config.req_ops_supported
& VS_BLK_DISCARD_OP_F) { & VS_BLK_DISCARD_OP_F) {
#if KERNEL_VERSION(5, 19, 0) > LINUX_VERSION_CODE
blk_queue_flag_set(QUEUE_FLAG_DISCARD, vblkdev->queue); blk_queue_flag_set(QUEUE_FLAG_DISCARD, vblkdev->queue);
#endif
blk_queue_max_discard_sectors(vblkdev->queue, blk_queue_max_discard_sectors(vblkdev->queue,
vblkdev->config.blk_config.max_erase_blks_per_io); vblkdev->config.blk_config.max_erase_blks_per_io);
vblkdev->queue->limits.discard_granularity = vblkdev->queue->limits.discard_granularity =
vblkdev->config.blk_config.hardblk_size; vblkdev->config.blk_config.hardblk_size;
#if KERNEL_VERSION(5, 19, 0) > LINUX_VERSION_CODE
if (vblkdev->config.blk_config.req_ops_supported & if (vblkdev->config.blk_config.req_ops_supported &
VS_BLK_SECURE_ERASE_OP_F) VS_BLK_SECURE_ERASE_OP_F)
blk_queue_flag_set(QUEUE_FLAG_SECERASE, vblkdev->queue); blk_queue_flag_set(QUEUE_FLAG_SECERASE, vblkdev->queue);
#endif
} }
/* And the gendisk structure. */ /* And the gendisk structure. */