util: Finally kill off md_get_version()

Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
This commit is contained in:
Jes Sorensen 2017-04-05 15:49:18 -04:00
parent b6e60be628
commit 303949f6f0
2 changed files with 0 additions and 30 deletions

View File

@ -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 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);

29
util.c
View File

@ -273,35 +273,6 @@ int parse_uuid(char *str, int uuid[4])
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;