diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-10 10:50:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-10 10:50:33 +0000 |
commit | b91e755b8dfd53f713b588a649dd69c2bb8c8c92 (patch) | |
tree | 9d6f22932d0da01b8a149aa642b1bfadd8998991 /lib.c | |
parent | Releasing debian version 4.2+20231026-1. (diff) | |
download | mdadm-b91e755b8dfd53f713b588a649dd69c2bb8c8c92.tar.xz mdadm-b91e755b8dfd53f713b588a649dd69c2bb8c8c92.zip |
Merging upstream version 4.2+20231121.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -204,35 +204,6 @@ char *fd2devnm(int fd) return NULL; } -/* When we create a new array, we don't want the content to - * be immediately examined by udev - it is probably meaningless. - * So create /run/mdadm/creating-mdXXX and expect that a udev - * rule will noticed this and act accordingly. - */ -static char block_path[] = "/run/mdadm/creating-%s"; -static char *unblock_path = NULL; -void udev_block(char *devnm) -{ - int fd; - char *path = NULL; - - xasprintf(&path, block_path, devnm); - fd = open(path, O_CREAT|O_RDWR, 0600); - if (fd >= 0) { - close(fd); - unblock_path = path; - } else - free(path); -} - -void udev_unblock(void) -{ - if (unblock_path) - unlink(unblock_path); - free(unblock_path); - unblock_path = NULL; -} - /* * convert a major/minor pair for a block device into a name in /dev, if possible. * On the first call, walk /dev collecting name. @@ -539,19 +510,6 @@ int check_env(char *name) return 0; } -int use_udev(void) -{ - static int use = -1; - struct stat stb; - - if (use < 0) { - use = ((stat("/dev/.udev", &stb) == 0 || - stat("/run/udev", &stb) == 0) && - check_env("MDADM_NO_UDEV") == 0); - } - return use; -} - unsigned long GCD(unsigned long a, unsigned long b) { while (a != b) { |