]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
util: Finally kill off md_get_version()
authorJes Sorensen <Jes.Sorensen@gmail.com>
Wed, 5 Apr 2017 19:49:18 +0000 (15:49 -0400)
committerJes Sorensen <Jes.Sorensen@gmail.com>
Wed, 5 Apr 2017 19:49:18 +0000 (15:49 -0400)
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
mdadm.h
util.c

diff --git a/mdadm.h b/mdadm.h
index 612bd863eef315b13490a2d7183aa1d2e755f1a6..f1f643c794d4b36fb1065d3450ab24d4aaa488db 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -1404,7 +1404,6 @@ extern int Dump_metadata(char *dev, char *dir, struct context *c,
 extern int Restore_metadata(char *dev, char *dir, struct context *c,
                            struct supertype *st, int only);
 
 extern int Restore_metadata(char *dev, char *dir, struct context *c,
                            struct supertype *st, int only);
 
-extern int md_get_version(int fd);
 int md_get_array_info(int fd, struct mdu_array_info_s *array);
 int md_set_array_info(int fd, struct mdu_array_info_s *array);
 int md_get_disk_info(int fd, struct mdu_disk_info_s *disk);
 int md_get_array_info(int fd, struct mdu_array_info_s *array);
 int md_set_array_info(int fd, struct mdu_array_info_s *array);
 int md_get_disk_info(int fd, struct mdu_disk_info_s *disk);
diff --git a/util.c b/util.c
index afeb6a5d92d13b06595de2a23d111e392e1c8940..a536f81f9157715145f25cc6c07ecfc2e226fa79 100644 (file)
--- a/util.c
+++ b/util.c
@@ -273,35 +273,6 @@ int parse_uuid(char *str, int uuid[4])
        return 0;
 }
 
        return 0;
 }
 
-/*
- * Get the md version number.
- * We use the RAID_VERSION ioctl if it is supported
- * If not, but we have a block device with major '9', we assume
- * 0.36.0
- *
- * Return version number as 24 but number - assume version parts
- * always < 255
- */
-
-int md_get_version(int fd)
-{
-       struct stat stb;
-       mdu_version_t vers;
-
-       if (fstat(fd, &stb)<0)
-               return -1;
-       if ((S_IFMT&stb.st_mode) != S_IFBLK)
-               return -1;
-
-       if (ioctl(fd, RAID_VERSION, &vers) == 0)
-               return  (vers.major*10000) + (vers.minor*100) + vers.patchlevel;
-       if (errno == EACCES)
-               return -1;
-       if (major(stb.st_rdev) == MD_MAJOR)
-               return (3600);
-       return -1;
-}
-
 int get_linux_version()
 {
        struct utsname name;
 int get_linux_version()
 {
        struct utsname name;