]> granicus.if.org Git - sysstat/commitdiff
common.c: Remove unused get_dev_part_nr() function
authorSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 27 Apr 2020 13:55:50 +0000 (15:55 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 27 Apr 2020 13:55:50 +0000 (15:55 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
common.c

index ce4f58a259b67de50ee683bd6a7a16c0fd285b36..7071ec6ed15d4a8ed25b9a79fe5520c8e87eee97 100644 (file)
--- a/common.c
+++ b/common.c
@@ -465,52 +465,6 @@ int count_csvalues(int arg_c, char **arg_v)
        return nr;
 }
 
-/*
- ***************************************************************************
- * Look for partitions of a given block device in /sys filesystem.
- *
- * IN:
- * @dev_name   Name of the block device.
- *
- * RETURNS:
- * Number of partitions for the given block device.
- ***************************************************************************
- */
-int get_dev_part_nr(char *dev_name)
-{
-       DIR *dir;
-       struct dirent *drd;
-       char dfile[MAX_PF_NAME], line[MAX_PF_NAME];
-       int part = 0, err;
-
-       snprintf(dfile, MAX_PF_NAME, "%s/%s", SYSFS_BLOCK, dev_name);
-       dfile[MAX_PF_NAME - 1] = '\0';
-
-       /* Open current device directory in /sys/block */
-       if ((dir = opendir(dfile)) == NULL)
-               return 0;
-
-       /* Get current file entry */
-       while ((drd = readdir(dir)) != NULL) {
-               if (!strcmp(drd->d_name, ".") || !strcmp(drd->d_name, ".."))
-                       continue;
-               err = snprintf(line, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
-               if ((err < 0) || (err >= MAX_PF_NAME))
-                       continue;
-
-               /* Try to guess if current entry is a directory containing a stat file */
-               if (!access(line, R_OK)) {
-                       /* Yep... */
-                       part++;
-               }
-       }
-
-       /* Close directory */
-       closedir(dir);
-
-       return part;
-}
-
 /*
  ***************************************************************************
  * Read /proc/devices file and get device-mapper major number.