summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@gmail.com>2017-03-29 20:35:41 +0200
committerJes Sorensen <Jes.Sorensen@gmail.com>2017-03-29 20:35:41 +0200
commit9cd39f015558dba82c293a4433b481b921ceec87 (patch)
tree324f4d170f41b88d9941b06c832638a0ba232950 /Create.c
parentGrow: Fixup a pile of cosmetic issues (diff)
downloadmdadm-9cd39f015558dba82c293a4433b481b921ceec87.tar.xz
mdadm-9cd39f015558dba82c293a4433b481b921ceec87.zip
util: Introduce md_get_array_info()
Remove most direct ioctl calls for GET_ARRAY_INFO, except for one, which will be addressed in the next patch. This is the start of the effort to clean up the use of ioctl calls and introduce a more structured API, which will use sysfs and fall back to ioctl for backup. Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Create.c b/Create.c
index 10e7d108..0e0778ff 100644
--- a/Create.c
+++ b/Create.c
@@ -156,8 +156,7 @@ int Create(struct supertype *st, char *mddev,
memset(&inf, 0, sizeof(inf));
fd = open(devlist->devname, O_RDONLY);
if (fd >= 0 &&
- ioctl(fd, GET_ARRAY_INFO, &inf) == 0 &&
- inf.raid_disks == 0) {
+ md_get_array_info(fd, &inf) == 0 && inf.raid_disks == 0) {
/* yep, looks like a container */
if (st) {
rv = st->ss->load_container(st, fd,
@@ -634,7 +633,7 @@ int Create(struct supertype *st, char *mddev,
} else {
mdu_array_info_t inf;
memset(&inf, 0, sizeof(inf));
- ioctl(mdfd, GET_ARRAY_INFO, &inf);
+ md_get_array_info(mdfd, &inf);
if (inf.working_disks != 0) {
pr_err("another array by this name is already running.\n");
goto abort_locked;