From 286cd2006bd6426f19d2dd312441755624ed260e Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 16 Aug 2012 19:24:09 +0200 Subject: [PATCH] cleanup: drop unneeded included header files This headers were not resolving anything used for compiled .c files. Remove unused util.c file. --- daemons/clvmd/clvmd-command.c | 3 --- daemons/dmeventd/dmeventd.c | 2 -- daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c | 2 -- .../plugins/snapshot/dmeventd_snapshot.c | 2 -- daemons/dmeventd/plugins/thin/dmeventd_thin.c | 2 -- daemons/lvmetad/lvmetad-core.c | 1 - lib/Makefile.in | 1 - lib/activate/dev_manager.c | 1 - lib/cache/lvmetad.c | 1 - lib/config/config.c | 2 -- lib/device/dev-swap.c | 2 -- lib/error/errseg.c | 5 ----- lib/filters/filter-md.c | 1 - lib/filters/filter-sysfs.c | 1 - lib/format1/import-export.c | 1 - lib/format_pool/import_export.c | 1 - lib/format_pool/pool_label.c | 1 - lib/format_text/archive.c | 1 - lib/format_text/archiver.c | 1 - lib/format_text/format-text.c | 2 -- lib/format_text/import.c | 3 --- lib/format_text/text_label.c | 1 - lib/freeseg/freeseg.c | 10 --------- lib/log/log.c | 3 --- lib/metadata/merge.c | 1 - lib/metadata/metadata.c | 1 - lib/metadata/mirror.c | 1 - lib/metadata/pv_manip.c | 2 -- lib/metadata/pv_map.c | 1 - lib/metadata/raid_manip.c | 3 --- lib/mirror/mirrored.c | 1 - lib/misc/lvm-file.c | 1 - lib/misc/lvm-globals.c | 1 - lib/misc/sharedlib.c | 2 -- lib/misc/util.c | 22 ------------------- lib/replicator/replicator.c | 3 --- lib/report/report.c | 1 - lib/thin/thin.c | 2 -- lib/unknown/unknown.c | 6 ----- lib/zero/zero.c | 5 ----- libdm/libdm-deptree.c | 1 - tools/dmsetup.c | 1 - tools/lvcreate.c | 1 - tools/lvmcmdlib.c | 3 --- tools/lvmcmdline.c | 3 --- tools/toollib.c | 4 ---- tools/vgreduce.c | 1 - 47 files changed, 117 deletions(-) delete mode 100644 lib/misc/util.c diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c index 0494ee4b3..c5cd4618a 100644 --- a/daemons/clvmd/clvmd-command.c +++ b/daemons/clvmd/clvmd-command.c @@ -51,9 +51,6 @@ */ #include "clvmd-common.h" - -#include - #include "clvmd-comms.h" #include "clvm.h" #include "clvmd.h" diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index 2ffe7f4d4..13148c3a2 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -39,8 +39,6 @@ #include /* for htonl, ntohl */ #ifdef linux -# include - /* * Kernel version 2.6.36 and higher has * new OOM killer adjustment interface. diff --git a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c index 1bde50ea6..5d5a46b80 100644 --- a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c +++ b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c @@ -16,8 +16,6 @@ #include "log.h" #include "lvm2cmd.h" -#include "errors.h" -#include "libdevmapper-event.h" #include "dmeventd_lvm.h" #include diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c index 0c59e340a..205218abb 100644 --- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c +++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c @@ -19,8 +19,6 @@ #include "libdevmapper-event.h" #include "dmeventd_lvm.h" -#include "lvm-string.h" - #include #include /* FIXME Replace syslog with multilog */ /* FIXME Missing openlog? */ diff --git a/daemons/dmeventd/plugins/thin/dmeventd_thin.c b/daemons/dmeventd/plugins/thin/dmeventd_thin.c index 4bdad232c..5a408a869 100644 --- a/daemons/dmeventd/plugins/thin/dmeventd_thin.c +++ b/daemons/dmeventd/plugins/thin/dmeventd_thin.c @@ -19,8 +19,6 @@ #include "libdevmapper-event.h" #include "dmeventd_lvm.h" -#include "lvm-string.h" - #include #include /* FIXME Replace syslog with multilog */ /* FIXME Missing openlog? */ diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c index d06ff46a9..3ca3fd52e 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/lib/Makefile.in b/lib/Makefile.in index 5252658ec..82f700b10 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -103,7 +103,6 @@ SOURCES =\ misc/lvm-string.c \ misc/lvm-wrappers.c \ misc/lvm-percent.c \ - misc/util.c \ mm/memlock.c \ report/properties.c \ report/report.c \ diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 40b0edc8b..122741c19 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -14,7 +14,6 @@ */ #include "lib.h" -#include "str_list.h" #include "dev_manager.h" #include "lvm-string.h" #include "fs.h" diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index 3384ec4fa..bb949b5e3 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -20,7 +20,6 @@ #include "lvmcache.h" #include "lvmetad-client.h" #include "format-text.h" // TODO for disk_locn, used as a DA representation -#include "filter.h" static int _using_lvmetad = 0; static daemon_handle _lvmetad; diff --git a/lib/config/config.c b/lib/config/config.c index 60ae6c8b6..a7bda9780 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -21,14 +21,12 @@ #include "device.h" #include "str_list.h" #include "toolcontext.h" -#include "lvm-string.h" #include "lvm-file.h" #include #include #include #include -#include #include struct config_file { diff --git a/lib/device/dev-swap.c b/lib/device/dev-swap.c index f742bfe1a..346b60a0a 100644 --- a/lib/device/dev-swap.c +++ b/lib/device/dev-swap.c @@ -14,8 +14,6 @@ #include "lib.h" #include "metadata.h" -#include "xlate.h" -#include "filter.h" #ifdef linux diff --git a/lib/error/errseg.c b/lib/error/errseg.c index a2fbc4d6d..179f1a6fd 100644 --- a/lib/error/errseg.c +++ b/lib/error/errseg.c @@ -16,15 +16,10 @@ #include "toolcontext.h" #include "segtype.h" #include "display.h" -#include "text_export.h" -#include "text_import.h" #include "config.h" #include "str_list.h" -#include "targets.h" -#include "lvm-string.h" #include "activate.h" #include "str_list.h" -#include "metadata.h" static const char *_errseg_name(const struct lv_segment *seg) { diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c index 5cd8fb233..e3e88f113 100644 --- a/lib/filters/filter-md.c +++ b/lib/filters/filter-md.c @@ -15,7 +15,6 @@ #include "lib.h" #include "filter-md.h" -#include "metadata.h" #ifdef linux diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c index 112e77cc2..ebd16a2ba 100644 --- a/lib/filters/filter-sysfs.c +++ b/lib/filters/filter-sysfs.c @@ -14,7 +14,6 @@ #include "lib.h" #include "filter-sysfs.h" -#include "lvm-string.h" #ifdef linux diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c index 1370d1236..5c5d89067 100644 --- a/lib/format1/import-export.c +++ b/lib/format1/import-export.c @@ -25,7 +25,6 @@ #include "segtype.h" #include "pv_alloc.h" #include "display.h" -#include "lvmcache.h" #include "metadata.h" #include diff --git a/lib/format_pool/import_export.c b/lib/format_pool/import_export.c index f7f619e84..480fa1c29 100644 --- a/lib/format_pool/import_export.c +++ b/lib/format_pool/import_export.c @@ -16,7 +16,6 @@ #include "lib.h" #include "label.h" #include "metadata.h" -#include "lvmcache.h" #include "disk_rep.h" #include "sptype_names.h" #include "lv_alloc.h" diff --git a/lib/format_pool/pool_label.c b/lib/format_pool/pool_label.c index 2d34e6085..7059b9830 100644 --- a/lib/format_pool/pool_label.c +++ b/lib/format_pool/pool_label.c @@ -16,7 +16,6 @@ #include "lib.h" #include "label.h" #include "metadata.h" -#include "xlate.h" #include "disk_rep.h" #include "pool_label.h" diff --git a/lib/format_text/archive.c b/lib/format_text/archive.c index c9611501d..18fe57706 100644 --- a/lib/format_text/archive.c +++ b/lib/format_text/archive.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c index 13d242aa0..ccefb4cea 100644 --- a/lib/format_text/archiver.c +++ b/lib/format_text/archiver.c @@ -16,7 +16,6 @@ #include "lib.h" #include "archiver.h" #include "format-text.h" -#include "lvm-file.h" #include "lvm-string.h" #include "lvmcache.h" #include "toolcontext.h" diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index aea03c9dc..d706c2bb9 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -27,12 +27,10 @@ #include "crc.h" #include "xlate.h" #include "label.h" -#include "memlock.h" #include "lvmcache.h" #include "lvmetad.h" #include -#include #include #include #include diff --git a/lib/format_text/import.c b/lib/format_text/import.c index 3d2f49616..8a05ca9f7 100644 --- a/lib/format_text/import.c +++ b/lib/format_text/import.c @@ -16,9 +16,6 @@ #include "lib.h" #include "metadata.h" #include "import-export.h" -#include "display.h" -#include "toolcontext.h" -#include "lvmcache.h" /* FIXME Use tidier inclusion method */ static struct text_vg_version_ops *(_text_vsn_list[2]); diff --git a/lib/format_text/text_label.c b/lib/format_text/text_label.c index 7b2659c5f..f53aa0d55 100644 --- a/lib/format_text/text_label.c +++ b/lib/format_text/text_label.c @@ -19,7 +19,6 @@ #include "label.h" #include "xlate.h" #include "lvmcache.h" -#include "lvmetad.h" #include #include diff --git a/lib/freeseg/freeseg.c b/lib/freeseg/freeseg.c index 6fbad7ec7..1dce24370 100644 --- a/lib/freeseg/freeseg.c +++ b/lib/freeseg/freeseg.c @@ -15,16 +15,6 @@ #include "lib.h" #include "toolcontext.h" #include "segtype.h" -#include "display.h" -#include "text_export.h" -#include "text_import.h" -#include "config.h" -#include "str_list.h" -#include "targets.h" -#include "lvm-string.h" -#include "activate.h" -#include "str_list.h" -#include "metadata.h" static const char *_freeseg_name(const struct lv_segment *seg) { diff --git a/lib/log/log.c b/lib/log/log.c index c36f1e799..d50cb4a42 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -16,10 +16,7 @@ #include "lib.h" #include "device.h" #include "memlock.h" -#include "lvm-string.h" -#include "lvm-file.h" #include "defaults.h" -#include "config.h" #include #include diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c index 4183046f6..cc906d1f6 100644 --- a/lib/metadata/merge.c +++ b/lib/metadata/merge.c @@ -15,7 +15,6 @@ #include "lib.h" #include "metadata.h" -#include "toolcontext.h" #include "lv_alloc.h" #include "pv_alloc.h" #include "str_list.h" diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index c14125aaf..dd029acaf 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -30,7 +30,6 @@ #include "locking.h" #include "archiver.h" #include "defaults.h" -#include "filter-persistent.h" #include #include diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 0997c5880..ac885d6dd 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -24,7 +24,6 @@ #include "lvm-string.h" #include "str_list.h" #include "locking.h" /* FIXME Should not be used in this file */ -#include "memlock.h" #include "defaults.h" /* FIXME: should this be defaults.h? */ diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c index e3fe2723a..e85a2bc53 100644 --- a/lib/metadata/pv_manip.c +++ b/lib/metadata/pv_manip.c @@ -17,9 +17,7 @@ #include "metadata.h" #include "pv_alloc.h" #include "toolcontext.h" -#include "archiver.h" #include "locking.h" -#include "lvmcache.h" #include "defaults.h" static struct pv_segment *_alloc_pv_segment(struct dm_pool *mem, diff --git a/lib/metadata/pv_map.c b/lib/metadata/pv_map.c index 29d235f3a..48a601e93 100644 --- a/lib/metadata/pv_map.c +++ b/lib/metadata/pv_map.c @@ -15,7 +15,6 @@ #include "lib.h" #include "pv_map.h" -#include "pv_alloc.h" #include diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index a3d6709ca..c86bb9a79 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -17,12 +17,9 @@ #include "toolcontext.h" #include "segtype.h" #include "display.h" -#include "archiver.h" #include "activate.h" #include "lv_alloc.h" #include "lvm-string.h" -#include "str_list.h" -#include "memlock.h" #define RAID_REGION_SIZE 1024 diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c index 28e4a1db2..7ce847595 100644 --- a/lib/mirror/mirrored.c +++ b/lib/mirror/mirrored.c @@ -25,7 +25,6 @@ #include "lvm-string.h" #include "targets.h" #include "activate.h" -#include "sharedlib.h" #include "str_list.h" #include diff --git a/lib/misc/lvm-file.c b/lib/misc/lvm-file.c index d71737b7f..b8e49cb34 100644 --- a/lib/misc/lvm-file.c +++ b/lib/misc/lvm-file.c @@ -15,7 +15,6 @@ #include "lib.h" #include "lvm-file.h" -#include "lvm-string.h" #include #include diff --git a/lib/misc/lvm-globals.c b/lib/misc/lvm-globals.c index e1512f904..1c72f85af 100644 --- a/lib/misc/lvm-globals.c +++ b/lib/misc/lvm-globals.c @@ -17,7 +17,6 @@ #include "device.h" #include "memlock.h" #include "lvm-string.h" -#include "lvm-file.h" #include "defaults.h" #include "metadata-exported.h" diff --git a/lib/misc/sharedlib.c b/lib/misc/sharedlib.c index 48fa522b3..4c2d17824 100644 --- a/lib/misc/sharedlib.c +++ b/lib/misc/sharedlib.c @@ -15,9 +15,7 @@ #include "lib.h" #include "config.h" -#include "lvm-string.h" #include "sharedlib.h" -#include "toolcontext.h" #include #include diff --git a/lib/misc/util.c b/lib/misc/util.c deleted file mode 100644 index 75c7afab6..000000000 --- a/lib/misc/util.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2007 Red Hat, Inc. All rights reserved. - * - * This file is part of LVM2. - * - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License v.2.1. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Return the address of the last file name component of NAME. - * If NAME ends in a slash, return the empty string. - */ - -#include "lib.h" - -/* empty for now. */ diff --git a/lib/replicator/replicator.c b/lib/replicator/replicator.c index 2571e8135..76bdbcaed 100644 --- a/lib/replicator/replicator.c +++ b/lib/replicator/replicator.c @@ -17,12 +17,9 @@ #include "metadata.h" #include "segtype.h" #include "text_export.h" -#include "text_import.h" -#include "config.h" #include "activate.h" #include "str_list.h" #ifdef DMEVENTD -# include "sharedlib.h" # include "libdevmapper-event.h" #endif diff --git a/lib/report/report.c b/lib/report/report.c index a8553d205..eeca282c9 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -21,7 +21,6 @@ #include "display.h" #include "activate.h" #include "segtype.h" -#include "str_list.h" #include "lvmcache.h" #include /* offsetof() */ diff --git a/lib/thin/thin.c b/lib/thin/thin.c index d95b68ea4..8aa8121ae 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -17,14 +17,12 @@ #include "metadata.h" #include "segtype.h" #include "text_export.h" -#include "text_import.h" #include "config.h" #include "activate.h" #include "str_list.h" #include "defaults.h" #ifdef DMEVENTD -# include "sharedlib.h" # include "libdevmapper-event.h" #endif diff --git a/lib/unknown/unknown.c b/lib/unknown/unknown.c index 8f5c8096c..f2a65eb82 100644 --- a/lib/unknown/unknown.c +++ b/lib/unknown/unknown.c @@ -17,14 +17,8 @@ #include "segtype.h" #include "display.h" #include "text_export.h" -#include "text_import.h" #include "config.h" -#include "str_list.h" -#include "targets.h" -#include "lvm-string.h" #include "activate.h" -#include "str_list.h" -#include "metadata.h" static const char *_unknown_name(const struct lv_segment *seg) { diff --git a/lib/zero/zero.c b/lib/zero/zero.c index 9611e9bb0..473daa046 100644 --- a/lib/zero/zero.c +++ b/lib/zero/zero.c @@ -16,14 +16,9 @@ #include "toolcontext.h" #include "segtype.h" #include "display.h" -#include "text_export.h" -#include "text_import.h" #include "config.h" #include "str_list.h" -#include "targets.h" -#include "lvm-string.h" #include "activate.h" -#include "metadata.h" static const char *_zero_name(const struct lv_segment *seg) { diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 031ce5eeb..503b24031 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -16,7 +16,6 @@ #include "libdm-targets.h" #include "libdm-common.h" #include "kdev_t.h" -#include "dm-ioctl.h" #include #include diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 7d1f2a13b..0734dedcd 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 6aecf1d09..769ac8cbe 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -14,7 +14,6 @@ */ #include "tools.h" -#include "lv_alloc.h" #include diff --git a/tools/lvmcmdlib.c b/tools/lvmcmdlib.c index 47bf1c888..6b641c239 100644 --- a/tools/lvmcmdlib.c +++ b/tools/lvmcmdlib.c @@ -17,13 +17,10 @@ #include "lvm2cmdline.h" #include "label.h" #include "memlock.h" -#include "lvm-version.h" #include "lvm2cmd.h" #include -#include -#include #include #include #include diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 99648170f..eea874e9d 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -19,12 +19,9 @@ #include "lvm-version.h" #include "stub.h" -#include "lvm2cmd.h" #include "last-path-component.h" #include -#include -#include #include #include #include diff --git a/tools/toollib.c b/tools/toollib.c index 0f6810b61..d6fc95199 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -14,11 +14,7 @@ */ #include "tools.h" -#include "lv_alloc.h" -#include "xlate.h" - #include -#include const char *command_name(struct cmd_context *cmd) { diff --git a/tools/vgreduce.c b/tools/vgreduce.c index ab448e050..969665136 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -14,7 +14,6 @@ */ #include "tools.h" -#include "lv_alloc.h" static int _remove_pv(struct volume_group *vg, struct pv_list *pvl, int silent) {