1
0

scsi: target: Add atomic se_device fields

Add atomic fields to the se_device and export them in configfs.

Initially only target_core_iblock will be supported and we will inherit
all the settings from the block layer.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
jpg: Stop being allowed to configure atomic write alignment,
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://patch.msgid.link/20251020103820.2917593-3-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Mike Christie
2025-10-20 10:38:15 +00:00
committed by Martin K. Petersen
parent 3434be3920
commit d505447b8d
2 changed files with 20 additions and 0 deletions

View File

@@ -578,6 +578,11 @@ DEF_CONFIGFS_ATTRIB_SHOW(unmap_zeroes_data);
DEF_CONFIGFS_ATTRIB_SHOW(max_write_same_len); DEF_CONFIGFS_ATTRIB_SHOW(max_write_same_len);
DEF_CONFIGFS_ATTRIB_SHOW(emulate_rsoc); DEF_CONFIGFS_ATTRIB_SHOW(emulate_rsoc);
DEF_CONFIGFS_ATTRIB_SHOW(submit_type); DEF_CONFIGFS_ATTRIB_SHOW(submit_type);
DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_len);
DEF_CONFIGFS_ATTRIB_SHOW(atomic_alignment);
DEF_CONFIGFS_ATTRIB_SHOW(atomic_granularity);
DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_with_boundary);
DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_boundary);
#define DEF_CONFIGFS_ATTRIB_STORE_U32(_name) \ #define DEF_CONFIGFS_ATTRIB_STORE_U32(_name) \
static ssize_t _name##_store(struct config_item *item, const char *page,\ static ssize_t _name##_store(struct config_item *item, const char *page,\
@@ -1300,6 +1305,11 @@ CONFIGFS_ATTR(, max_write_same_len);
CONFIGFS_ATTR(, alua_support); CONFIGFS_ATTR(, alua_support);
CONFIGFS_ATTR(, pgr_support); CONFIGFS_ATTR(, pgr_support);
CONFIGFS_ATTR(, submit_type); CONFIGFS_ATTR(, submit_type);
CONFIGFS_ATTR_RO(, atomic_max_len);
CONFIGFS_ATTR_RO(, atomic_alignment);
CONFIGFS_ATTR_RO(, atomic_granularity);
CONFIGFS_ATTR_RO(, atomic_max_with_boundary);
CONFIGFS_ATTR_RO(, atomic_max_boundary);
/* /*
* dev_attrib attributes for devices using the target core SBC/SPC * dev_attrib attributes for devices using the target core SBC/SPC
@@ -1343,6 +1353,11 @@ struct configfs_attribute *sbc_attrib_attrs[] = {
&attr_pgr_support, &attr_pgr_support,
&attr_emulate_rsoc, &attr_emulate_rsoc,
&attr_submit_type, &attr_submit_type,
&attr_atomic_alignment,
&attr_atomic_max_len,
&attr_atomic_granularity,
&attr_atomic_max_with_boundary,
&attr_atomic_max_boundary,
NULL, NULL,
}; };
EXPORT_SYMBOL(sbc_attrib_attrs); EXPORT_SYMBOL(sbc_attrib_attrs);

View File

@@ -731,6 +731,11 @@ struct se_dev_attrib {
u32 unmap_granularity; u32 unmap_granularity;
u32 unmap_granularity_alignment; u32 unmap_granularity_alignment;
u32 max_write_same_len; u32 max_write_same_len;
u32 atomic_max_len;
u32 atomic_alignment;
u32 atomic_granularity;
u32 atomic_max_with_boundary;
u32 atomic_max_boundary;
u8 submit_type; u8 submit_type;
struct se_device *da_dev; struct se_device *da_dev;
struct config_group da_group; struct config_group da_group;