提交 6b206a5a 编写于 作者: M Mike Christie 提交者: Martin K. Petersen

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.comReviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMike Christie <michael.christie@oracle.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 036d8903
...@@ -960,6 +960,12 @@ int target_configure_device(struct se_device *dev) ...@@ -960,6 +960,12 @@ int target_configure_device(struct se_device *dev)
ret = dev->transport->configure_device(dev); ret = dev->transport->configure_device(dev);
if (ret) if (ret)
goto out_free_index; 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.. * XXX: there is not much point to have two different values here..
*/ */
......
...@@ -37,6 +37,7 @@ struct target_backend_ops { ...@@ -37,6 +37,7 @@ struct target_backend_ops {
struct se_dev_plug *(*plug_device)(struct se_device *se_dev); struct se_dev_plug *(*plug_device)(struct se_device *se_dev);
void (*unplug_device)(struct se_dev_plug *se_plug); void (*unplug_device)(struct se_dev_plug *se_plug);
bool (*configure_unmap)(struct se_device *se_dev);
ssize_t (*set_configfs_dev_params)(struct se_device *, ssize_t (*set_configfs_dev_params)(struct se_device *,
const char *, ssize_t); const char *, ssize_t);
ssize_t (*show_configfs_dev_params)(struct se_device *, char *); ssize_t (*show_configfs_dev_params)(struct se_device *, char *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册