diff options
author | NeilBrown <neilb@suse.de> | 2013-01-07 00:17:04 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-01-07 00:17:04 +0100 |
commit | 06d2ffc3e266eea0cbd157ccc3e497c7b9f4bdd3 (patch) | |
tree | 1d328642932691c9d1912a53062014ba5fea1c07 /mdopen.c | |
parent | MISC: Add --examine-badblocks option (diff) | |
download | mdadm-06d2ffc3e266eea0cbd157ccc3e497c7b9f4bdd3.tar.xz mdadm-06d2ffc3e266eea0cbd157ccc3e497c7b9f4bdd3.zip |
conditionally remove map_dev from find_free_devnum
map_dev can be slow so it is best to not call it when
not necessary.
The final test in "find_free_devnum" is not relevant when
udev is being used, so remove the test in that case.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -330,8 +330,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, * If we cannot detect udev, we need to make * devices and links ourselves. */ - if ((stat("/dev/.udev", &stb) != 0 && stat("/run/udev", &stb) != 0) || - check_env("MDADM_NO_UDEV")) { + if (!use_udev()) { /* Make sure 'devname' exists and 'chosen' is a symlink to it */ if (lstat(devname, &stb) == 0) { /* Must be the correct device, else error */ |