diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-09-24 15:53:18 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-09-27 11:08:49 +0200 |
commit | d95edceb362a6b647ec454c2a83add11c4ed4e64 (patch) | |
tree | 0252bfed2ab558eeb9d4a33458a123c9c9cb2afd /mdadm.h | |
parent | Incremental: Rename IncrementalRemove (diff) | |
download | mdadm-d95edceb362a6b647ec454c2a83add11c4ed4e64.tar.xz mdadm-d95edceb362a6b647ec454c2a83add11c4ed4e64.zip |
sysfs: add function for writing to sysfs fd
Proposed function sysfs_wrte_descriptor() unifies error handling for
write() done to sysfs files. Main purpose is to use it with MD sysfs
file but it can be used elsewhere.
No functional changes.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -803,6 +803,9 @@ enum sysfs_read_flags { #define SYSFS_MAX_BUF_SIZE 64 +extern mdadm_status_t sysfs_write_descriptor(const int fd, const char *value, + const ssize_t len, int *errno_p); +extern mdadm_status_t write_attr(const char *value, const int fd); extern void sysfs_get_container_devnm(struct mdinfo *mdi, char *buf); /* If fd >= 0, get the array it is open on, |