diff options
author | Mike Christie <michael.christie@oracle.com> | 2022-06-28 15:02:27 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-07-07 16:53:52 -0400 |
commit | 6b206a5a8c2912c3c2174c5afc2f6e798d6ad212 (patch) | |
tree | bd98b2cb618038579a7800e3362f489d7769921d /drivers/target/target_core_device.c | |
parent | 036d8903f03b662bbdce5e32525bd2931b14c420 (diff) |
scsi: target: Add callout to configure UNMAP settings
Add a callout to configure a backend's UNMAP settings. This will be used to
allow userspace to configure UNMAP after the initial device setup, similar
to how we can set up the other attributes post device configuration.
Link: https://lore.kernel.org/r/20220628200230.15052-3-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r-- | drivers/target/target_core_device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 25f33eb25337..086ac9c9343c 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -960,6 +960,12 @@ int target_configure_device(struct se_device *dev) ret = dev->transport->configure_device(dev); if (ret) goto out_free_index; + + if (dev->transport->configure_unmap && + dev->transport->configure_unmap(dev)) { + pr_debug("Discard support available, but disabled by default.\n"); + } + /* * XXX: there is not much point to have two different values here.. */ |