diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-25 16:18:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-25 16:18:46 +0000 |
commit | bf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf (patch) | |
tree | abe74458156206a4adf2950b1cbcad241a72e80e /lib.c | |
parent | Adding upstream version 4.2. (diff) | |
download | mdadm-bf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf.tar.xz mdadm-bf5c2aa1d837ea8bb6a4c379ac125b1a41efc9bf.zip |
Adding upstream version 4.2+20230223.upstream/4.2+20230223
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -164,6 +164,18 @@ char *stat2devnm(struct stat *st) return devid2devnm(st->st_rdev); } +bool stat_is_md_dev(struct stat *st) +{ + if ((S_IFMT & st->st_mode) != S_IFBLK) + return false; + if (major(st->st_rdev) == MD_MAJOR) + return true; + if (major(st->st_rdev) == (unsigned)get_mdp_major()) + return true; + + return false; +} + char *fd2devnm(int fd) { struct stat stb; |