[dm-devel] [PATCH v2 03/12] kpartx: remove is_loop_device
Martin Wilck
mwilck at suse.com
Mon May 15 15:37:13 UTC 2017
This function is not used any more.
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
kpartx/lopart.c | 31 -------------------------------
kpartx/lopart.h | 1 -
2 files changed, 32 deletions(-)
diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index 2eb3f631..44f0c277 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -62,37 +62,6 @@ xstrdup (const char *s)
return t;
}
-int is_loop_device(const char *device)
-{
- struct stat statbuf;
- int loopmajor;
-#if 1
- loopmajor = 7;
-#else
- FILE *procdev;
- char line[100], *cp;
-
- loopmajor = 0;
-
- if ((procdev = fopen(PROC_DEVICES, "r")) != NULL) {
-
- while (fgets (line, sizeof(line), procdev)) {
-
- if ((cp = strstr (line, " loop\n")) != NULL) {
- *cp='\0';
- loopmajor=atoi(line);
- break;
- }
- }
-
- fclose(procdev);
- }
-#endif
- return (loopmajor && stat(device, &statbuf) == 0 &&
- S_ISBLK(statbuf.st_mode) &&
- major(statbuf.st_rdev) == loopmajor);
-}
-
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
char *find_loop_by_file(const char *filename)
diff --git a/kpartx/lopart.h b/kpartx/lopart.h
index a512353b..d3bad10a 100644
--- a/kpartx/lopart.h
+++ b/kpartx/lopart.h
@@ -1,6 +1,5 @@
extern int verbose;
extern int set_loop (const char *, const char *, int, int *);
extern int del_loop (const char *);
-extern int is_loop_device (const char *);
extern char * find_unused_loop_device (void);
extern char * find_loop_by_file (const char *);
--
2.12.2
More information about the dm-devel
mailing list