From 30a81e59894ed6c1fdb4a3bb0823b58de1e431cc Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 25 Jan 2012 23:26:33 +0100 Subject: [PATCH] cleanup: self compilable headers --- daemons/clvmd/clvm.h | 1 + daemons/dmeventd/libdevmapper-event.h | 1 + lib/datastruct/lvm-types.h | 2 ++ lib/datastruct/str_list.h | 3 +++ lib/device/device.h | 1 + lib/format_text/text_import.h | 3 +++ lib/metadata/lv.h | 4 ++-- lib/metadata/lv_alloc.h | 2 ++ lib/metadata/pv.h | 4 +++- lib/metadata/pv_alloc.h | 9 +++++++++ lib/metadata/vg.h | 6 +++--- lib/misc/crc.h | 2 ++ lib/uuid/uuid.h | 5 +++++ libdm/misc/dm-log-userspace.h | 2 ++ 14 files changed, 39 insertions(+), 6 deletions(-) diff --git a/daemons/clvmd/clvm.h b/daemons/clvmd/clvm.h index 8e24f157c..716af4027 100644 --- a/daemons/clvmd/clvm.h +++ b/daemons/clvmd/clvm.h @@ -23,6 +23,7 @@ #define _CLVM_H #include "configure.h" +#include struct clvm_header { uint8_t cmd; /* See below */ diff --git a/daemons/dmeventd/libdevmapper-event.h b/daemons/dmeventd/libdevmapper-event.h index 7ce3f397d..9c1cc6f98 100644 --- a/daemons/dmeventd/libdevmapper-event.h +++ b/daemons/dmeventd/libdevmapper-event.h @@ -48,6 +48,7 @@ enum dm_event_mask { #define DM_EVENT_ALL_ERRORS DM_EVENT_ERROR_MASK #define DM_EVENT_PROTOCOL_VERSION 1 +struct dm_task; struct dm_event_handler; struct dm_event_handler *dm_event_handler_create(void); diff --git a/lib/datastruct/lvm-types.h b/lib/datastruct/lvm-types.h index 53588506e..e96009d59 100644 --- a/lib/datastruct/lvm-types.h +++ b/lib/datastruct/lvm-types.h @@ -19,6 +19,8 @@ #include #include +#include "libdevmapper.h" + /* Define some portable printing types */ #define PRIsize_t "zu" #define PRIptrdiff_t "td" diff --git a/lib/datastruct/str_list.h b/lib/datastruct/str_list.h index 42f47da30..82141e188 100644 --- a/lib/datastruct/str_list.h +++ b/lib/datastruct/str_list.h @@ -16,6 +16,9 @@ #ifndef _LVM_STR_LIST_H #define _LVM_STR_LIST_H +struct dm_list; +struct dm_pool; + struct dm_list *str_list_create(struct dm_pool *mem); int str_list_add(struct dm_pool *mem, struct dm_list *sll, const char *str); void str_list_del(struct dm_list *sll, const char *str); diff --git a/lib/device/device.h b/lib/device/device.h index 1d6304d4a..e42f664e0 100644 --- a/lib/device/device.h +++ b/lib/device/device.h @@ -17,6 +17,7 @@ #define _LVM_DEVICE_H #include "uuid.h" +#include "lvm-types.h" #include diff --git a/lib/format_text/text_import.h b/lib/format_text/text_import.h index faebc07a1..1308a15ee 100644 --- a/lib/format_text/text_import.h +++ b/lib/format_text/text_import.h @@ -16,6 +16,9 @@ #ifndef _LVM_TEXT_IMPORT_H #define _LVM_TEXT_IMPORT_H +#include + +struct dm_hash_table; struct lv_segment; struct dm_config_node; diff --git a/lib/metadata/lv.h b/lib/metadata/lv.h index 06f8c6055..51920b08c 100644 --- a/lib/metadata/lv.h +++ b/lib/metadata/lv.h @@ -15,9 +15,9 @@ #ifndef _LVM_LV_H #define _LVM_LV_H +#include "vg.h" + union lvid; -struct volume_group; -struct dm_list; struct lv_segment; struct replicator_device; enum activation_change; diff --git a/lib/metadata/lv_alloc.h b/lib/metadata/lv_alloc.h index 9f8e0e3ac..acfebcada 100644 --- a/lib/metadata/lv_alloc.h +++ b/lib/metadata/lv_alloc.h @@ -16,6 +16,8 @@ #ifndef _LVM_LV_ALLOC_H #define _LVM_LV_ALLOC_H +#include "metadata-exported.h" + struct lv_segment *alloc_lv_segment(const struct segment_type *segtype, struct logical_volume *lv, uint32_t le, uint32_t len, diff --git a/lib/metadata/pv.h b/lib/metadata/pv.h index 8fd3061fa..2d436cb7b 100644 --- a/lib/metadata/pv.h +++ b/lib/metadata/pv.h @@ -15,7 +15,9 @@ #ifndef _LVM_PV_H #define _LVM_PV_H -struct id; +#include "uuid.h" +#include "libdevmapper.h" + struct device; struct format_type; struct volume_group; diff --git a/lib/metadata/pv_alloc.h b/lib/metadata/pv_alloc.h index 23184734b..929302e33 100644 --- a/lib/metadata/pv_alloc.h +++ b/lib/metadata/pv_alloc.h @@ -14,6 +14,15 @@ #ifndef _LVM_PV_ALLOC_H +#include + +struct dm_list; +struct dm_pool; +struct lv_segment; +struct physical_volume; +struct pv_segment; +struct volume_group; + int alloc_pv_segment_whole_pv(struct dm_pool *mem, struct physical_volume *pv); int peg_dup(struct dm_pool *mem, struct dm_list *peg_new, struct dm_list *peg_old); struct pv_segment *assign_peg_to_lvseg(struct physical_volume *pv, uint32_t pe, diff --git a/lib/metadata/vg.h b/lib/metadata/vg.h index 5cc5f6da5..43d27bf78 100644 --- a/lib/metadata/vg.h +++ b/lib/metadata/vg.h @@ -15,11 +15,11 @@ #ifndef _LVM_VG_H #define _LVM_VG_H +#include "uuid.h" +#include "libdevmapper.h" + struct cmd_context; -struct dm_pool; struct format_instance; -struct dm_list; -struct id; struct logical_volume; typedef enum { diff --git a/lib/misc/crc.h b/lib/misc/crc.h index 2910bc55b..007c610d5 100644 --- a/lib/misc/crc.h +++ b/lib/misc/crc.h @@ -16,6 +16,8 @@ #ifndef _LVM_CRC_H #define _LVM_CRC_H +#include + #define INITIAL_CRC 0xf597a6cf uint32_t calc_crc(uint32_t initial, const uint8_t *buf, uint32_t size); diff --git a/lib/uuid/uuid.h b/lib/uuid/uuid.h index 5c8382d75..60bec65f3 100644 --- a/lib/uuid/uuid.h +++ b/lib/uuid/uuid.h @@ -19,6 +19,11 @@ #define ID_LEN 32 #define ID_LEN_S "32" +#include +#include + +struct dm_pool; + struct id { int8_t uuid[ID_LEN]; }; diff --git a/libdm/misc/dm-log-userspace.h b/libdm/misc/dm-log-userspace.h index 331793867..6418300c5 100644 --- a/libdm/misc/dm-log-userspace.h +++ b/libdm/misc/dm-log-userspace.h @@ -7,6 +7,8 @@ #ifndef __DM_LOG_USERSPACE_H__ #define __DM_LOG_USERSPACE_H__ +#include + #include "dm-ioctl.h" /* For DM_UUID_LEN */ /*