From 06d2ffc3e266eea0cbd157ccc3e497c7b9f4bdd3 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 7 Jan 2013 10:17:04 +1100 Subject: 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 --- mdopen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mdopen.c') diff --git a/mdopen.c b/mdopen.c index 24188df..462743c 100644 --- a/mdopen.c +++ b/mdopen.c @@ -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 */ -- cgit v1.2.1