summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-09-24 15:53:18 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-09-27 11:08:49 +0200
commitd95edceb362a6b647ec454c2a83add11c4ed4e64 (patch)
tree0252bfed2ab558eeb9d4a33458a123c9c9cb2afd /mdadm.h
parentIncremental: Rename IncrementalRemove (diff)
downloadmdadm-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index d4f5702c..ce8155b5 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -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,