History

scsi: drivers: base: Support atomic version of attribute_container_device_trigger

attribute_container_device_trigger invokes callbacks that may fail for one or more classdevs, for instance, the transport_add_class_device callback, called during transport creation, does memory allocation. This information, though, is not propagated to upper layers, and any driver using the attribute_container_device_trigger API will not know whether any, some, or all callbacks succeeded. This patch implements a safe version of this dispatcher, to either succeed all the callbacks or revert to the original state.

Gabriel Krisman Bertazi committed 6 years ago

Commit 7c1ef331 parent 54155ed2 files · +110 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/attribute_container.h+7−0
@@ -54,6 +54,13 @@ void attribute_container_device_trigger(struct device *dev, · 53 unmodified lines
5454 int (*fn)(struct attribute_container *,
5555 struct device *,
5656 struct device *));
57+int attribute_container_device_trigger_safe(struct device *dev,
58+ int (*fn)(struct attribute_container *,
59+ struct device *,
60+ struct device *),
61+ int (*undo)(struct attribute_container *,
62+ struct device *,
63+ struct device *));
5764 void attribute_container_trigger(struct device *dev,
5865 int (*fn)(struct attribute_container *,
5966 struct device *));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t