libnvmf_registry_attr_for_each-libnvme32
Iterate over attributes in a controller's registry entry
Usage
int libnvmf_registry_attr_for_each (struct libnvme_global_ctx *ctx , const char *device , void (*callback)(const char *attr, const char *value, void *user_data) , void *user_data );
Arguments
ctx
|
libnvme global context; must not be NULL |
|---|---|
device
|
Kernel device name (e.g. "nvme3") |
callback
|
Callback invoked for each attribute |
user_data
|
User data passed to callback |
Overview
Opens the registry directory for device and invokes callback for each attribute file found. Attribute files that disappear during iteration (e.g. because the device is removed concurrently) are silently skipped.
Return
0 on success, -ENOENT if the device directory does not exist at the time of the initial open, negative errno otherwise.