Version 2.02.71 -
===============================
+ Use __attribute__ consistently throughout.
Fix redundant declarations and always compile with -Wredundant-decls.
Fix possible hang when all mirror images of a mirrored log fail.
Do not log backtrace in valid _lv_resume() code path.
static void init_all(void);
static void cleanup_all(void);
-int main(int argc __attribute((unused)), char *argv[] __attribute((unused)))
+int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused)))
{
daemonize();
* @sig: the signal
*
*/
-static void parent_exit_handler(int sig __attribute((unused)))
+static void parent_exit_handler(int sig __attribute__((unused)))
{
exit_now = 1;
}
}
static char rq_buffer[DM_ULOG_REQUEST_SIZE];
-static int handle_cluster_request(struct clog_cpg *entry __attribute((unused)),
+static int handle_cluster_request(struct clog_cpg *entry __attribute__((unused)),
struct clog_request *rq, int server)
{
int r = 0;
return r;
}
-static int do_cluster_work(void *data __attribute((unused)))
+static int do_cluster_work(void *data __attribute__((unused)))
{
int r = SA_AIS_OK;
struct clog_cpg *entry, *tmp;
return 0;
}
-static void cpg_message_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute((unused)),
- uint32_t nodeid, uint32_t pid __attribute((unused)),
+static void cpg_message_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute__((unused)),
+ uint32_t nodeid, uint32_t pid __attribute__((unused)),
void *msg, size_t msg_len)
{
int i;
}
}
-static void cpg_config_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute((unused)),
+static void cpg_config_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute__((unused)),
const struct cpg_address *member_list,
size_t member_list_entries,
const struct cpg_address *left_list,
*/
#define COMPAT_OFFSET 256
-static void v5_data_endian_switch(struct clog_request *rq, int to_network __attribute((unused)))
+static void v5_data_endian_switch(struct clog_request *rq, int to_network __attribute__((unused)))
{
int i, end;
int64_t *pi64;
}
/* FIXME Rewrite this function taking advantage of the udev changes (where in use) to improve its efficiency! */
-static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_path __attribute((unused)))
+static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_path __attribute__((unused)))
{
int r;
DIR *dp;
return 0;
}
-static int core_status_info(struct log_c *lc __attribute((unused)), struct dm_ulog_request *rq)
+static int core_status_info(struct log_c *lc __attribute__((unused)), struct dm_ulog_request *rq)
{
int r;
char *data = (char *)rq->data;
*
* Returns: 0 on success, -EXXX on failure
*/
-static int do_local_work(void *data __attribute((unused)))
+static int do_local_work(void *data __attribute__((unused)))
{
int r;
struct clog_request *rq;
dm_lib_exit();
}
-static void _exit_timeout(void *unused __attribute((unused)))
+static void _exit_timeout(void *unused __attribute__((unused)))
{
_timeout_running = 0;
pthread_mutex_unlock(&_timeout_mutex);
}
/* Wake up monitor threads every so often. */
-static void *_timeout_thread(void *unused __attribute((unused)))
+static void *_timeout_thread(void *unused __attribute__((unused)))
{
struct timespec timeout;
time_t curr_time;
_unlock_mutex();
}
-static void _sig_alarm(int signum __attribute((unused)))
+static void _sig_alarm(int signum __attribute__((unused)))
{
pthread_testcancel();
}
* Set the global variable which the process should
* be watching to determine when to exit.
*/
-static void _exit_handler(int sig __attribute((unused)))
+static void _exit_handler(int sig __attribute__((unused)))
{
/*
* We exit when '_exit_now' is set.
* configurable and we don't have that option yet
*/
static void _temporary_log_fn(int level,
- const char *file __attribute((unused)),
- int line __attribute((unused)),
- int dm_errno __attribute((unused)),
+ const char *file __attribute__((unused)),
+ int line __attribute__((unused)),
+ int dm_errno __attribute__((unused)),
const char *message)
{
level &= ~(_LOG_STDERR | _LOG_ONCE);
}
void process_event(struct dm_task *dmt,
- enum dm_event_mask event __attribute((unused)),
- void **unused __attribute((unused)))
+ enum dm_event_mask event __attribute__((unused)),
+ void **unused __attribute__((unused)))
{
void *next = NULL;
uint64_t start, length;
}
int register_device(const char *device,
- const char *uuid __attribute((unused)),
- int major __attribute((unused)),
- int minor __attribute((unused)),
- void **unused __attribute((unused)))
+ const char *uuid __attribute__((unused)),
+ int major __attribute__((unused)),
+ int minor __attribute__((unused)),
+ void **unused __attribute__((unused)))
{
int r = dmeventd_lvm2_init();
syslog(LOG_INFO, "Monitoring mirror device %s for events.", device);
}
int unregister_device(const char *device,
- const char *uuid __attribute((unused)),
- int major __attribute((unused)),
- int minor __attribute((unused)),
- void **unused __attribute((unused)))
+ const char *uuid __attribute__((unused)),
+ int major __attribute__((unused)),
+ int minor __attribute__((unused)),
+ void **unused __attribute__((unused)))
{
syslog(LOG_INFO, "No longer monitoring mirror device %s for events.",
device);
}
void process_event(struct dm_task *dmt,
- enum dm_event_mask event __attribute((unused)),
+ enum dm_event_mask event __attribute__((unused)),
void **private)
{
void *next = NULL;
}
int register_device(const char *device,
- const char *uuid __attribute((unused)),
- int major __attribute((unused)),
- int minor __attribute((unused)),
+ const char *uuid __attribute__((unused)),
+ int major __attribute__((unused)),
+ int minor __attribute__((unused)),
void **private)
{
int *percent_warning = (int*)private;
}
int unregister_device(const char *device,
- const char *uuid __attribute((unused)),
- int major __attribute((unused)),
- int minor __attribute((unused)),
- void **unused __attribute((unused)))
+ const char *uuid __attribute__((unused)),
+ int major __attribute__((unused)),
+ int minor __attribute__((unused)),
+ void **unused __attribute__((unused)))
{
syslog(LOG_INFO, "No longer monitoring snapshot %s\n",
device);
{
struct dm_tree *dtree;
struct dm_tree_node *root;
- char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1] __attribute((aligned(8)));
+ char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1] __attribute__((aligned(8)));
int r = 1;
if (!(dtree = dm_tree_create())) {
*/
static void _store_metadata(struct volume_group *vg, unsigned precommitted)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
struct lvmcache_vginfo *vginfo;
int size;
return 1;
}
-void lvmcache_lock_vgname(const char *vgname, int read_only __attribute((unused)))
+void lvmcache_lock_vgname(const char *vgname, int read_only __attribute__((unused)))
{
if (!_lock_hash && !lvmcache_init()) {
log_error("Internal cache initialisation failed");
struct dm_list *devh, *tmp;
struct dm_list devs;
struct device_list *devl;
- char vgid_found[ID_LEN + 1] __attribute((aligned(8)));
+ char vgid_found[ID_LEN + 1] __attribute__((aligned(8)));
if (!(vginfo = vginfo_from_vgname(vgname, vgid)))
return NULL;
struct lvmcache_vginfo *vginfo_from_vgid(const char *vgid)
{
struct lvmcache_vginfo *vginfo;
- char id[ID_LEN + 1] __attribute((aligned(8)));
+ char id[ID_LEN + 1] __attribute__((aligned(8)));
if (!_vgid_hash || !vgid)
return NULL;
struct lvmcache_info *info_from_pvid(const char *pvid, int valid_only)
{
struct lvmcache_info *info;
- char id[ID_LEN + 1] __attribute((aligned(8)));
+ char id[ID_LEN + 1] __attribute__((aligned(8)));
if (!_pvid_hash || !pvid)
return NULL;
struct lvmcache_vginfo *primary_vginfo)
{
struct lvmcache_vginfo *last_vginfo = primary_vginfo;
- char uuid_primary[64] __attribute((aligned(8)));
- char uuid_new[64] __attribute((aligned(8)));
+ char uuid_primary[64] __attribute__((aligned(8)));
+ char uuid_new[64] __attribute__((aligned(8)));
int use_new = 0;
/* Pre-existing VG takes precedence. Unexported VG takes precedence. */
{
struct pv_list *pvl;
struct lvmcache_info *info;
- char pvid_s[ID_LEN + 1] __attribute((aligned(8)));
+ char pvid_s[ID_LEN + 1] __attribute__((aligned(8)));
pvid_s[sizeof(pvid_s) - 1] = '\0';
{
struct label *label;
struct lvmcache_info *existing, *info;
- char pvid_s[ID_LEN + 1] __attribute((aligned(8)));
+ char pvid_s[ID_LEN + 1] __attribute__((aligned(8)));
if (!_vgname_hash && !lvmcache_init()) {
log_error("Internal cache initialisation failed");
return 1;
}
-struct config_tree *create_config_tree_from_string(struct cmd_context *cmd __attribute((unused)),
+struct config_tree *create_config_tree_from_string(struct cmd_context *cmd __attribute__((unused)),
const char *config_settings)
{
struct cs *c;
int dev_set(struct device *dev, uint64_t offset, size_t len, int value)
{
size_t s;
- char buffer[4096] __attribute((aligned(8)));
+ char buffer[4096] __attribute__((aligned(8)));
if (!dev_open(dev))
return_0;
#else
-int dev_is_md(struct device *dev __attribute((unused)),
- uint64_t *sb __attribute((unused)))
+int dev_is_md(struct device *dev __attribute__((unused)),
+ uint64_t *sb __attribute__((unused)))
{
return 0;
}
-unsigned long dev_md_stripe_width(const char *sysfs_dir __attribute((unused)),
- struct device *dev __attribute((unused)))
+unsigned long dev_md_stripe_width(const char *sysfs_dir __attribute__((unused)),
+ struct device *dev __attribute__((unused)))
{
return 0UL;
}
void pvdisplay_colons(const struct physical_volume *pv)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!pv)
return;
/* FIXME Include label fields */
void pvdisplay_full(const struct cmd_context *cmd,
const struct physical_volume *pv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
const char *size;
uint32_t pe_free;
log_print(" ");
}
-int pvdisplay_short(const struct cmd_context *cmd __attribute((unused)),
- const struct volume_group *vg __attribute((unused)),
+int pvdisplay_short(const struct cmd_context *cmd __attribute__((unused)),
+ const struct volume_group *vg __attribute__((unused)),
const struct physical_volume *pv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!pv)
return 0;
int lvdisplay_full(struct cmd_context *cmd,
const struct logical_volume *lv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct lvinfo info;
int inkernel, snap_active = 0;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
struct lv_segment *snap_seg = NULL, *mirror_seg = NULL;
float snap_percent; /* fused, fsize; */
percent_range_t percent_range;
return 1;
}
-void vgdisplay_extents(const struct volume_group *vg __attribute((unused)))
+void vgdisplay_extents(const struct volume_group *vg __attribute__((unused)))
{
}
{
uint32_t access_str;
uint32_t active_pvs;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
active_pvs = vg->pv_count - vg_missing_pv_count(vg);
{
uint32_t active_pvs;
const char *access_str;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
active_pvs = vg->pv_count - vg_missing_pv_count(vg);
}
#ifdef DEVMAPPER_SUPPORT
-static int _errseg_add_target_line(struct dev_manager *dm __attribute((unused)),
- struct dm_pool *mem __attribute((unused)),
- struct cmd_context *cmd __attribute((unused)),
- void **target_state __attribute((unused)),
- struct lv_segment *seg __attribute((unused)),
+static int _errseg_add_target_line(struct dev_manager *dm __attribute__((unused)),
+ struct dm_pool *mem __attribute__((unused)),
+ struct cmd_context *cmd __attribute__((unused)),
+ void **target_state __attribute__((unused)),
+ struct lv_segment *seg __attribute__((unused)),
struct dm_tree_node *node, uint64_t len,
- uint32_t *pvmove_mirror_count __attribute((unused)))
+ uint32_t *pvmove_mirror_count __attribute__((unused)))
{
return dm_tree_node_add_error_target(node, len);
}
static int _errseg_target_present(struct cmd_context *cmd,
- const struct lv_segment *seg __attribute((unused)),
- unsigned *attributes __attribute((unused)))
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes __attribute__((unused)))
{
static int _errseg_checked = 0;
static int _errseg_present = 0;
#endif
static int _errseg_modules_needed(struct dm_pool *mem,
- const struct lv_segment *seg __attribute((unused)),
+ const struct lv_segment *seg __attribute__((unused)),
struct dm_list *modules)
{
if (!str_list_add(mem, modules, "error")) {
#ifdef linux
-static int _ignore_md(struct dev_filter *f __attribute((unused)),
+static int _ignore_md(struct dev_filter *f __attribute__((unused)),
struct device *dev)
{
int ret;
#else
-struct dev_filter *sysfs_filter_create(const char *sysfs_dir __attribute((unused)))
+struct dev_filter *sysfs_filter_create(const char *sysfs_dir __attribute__((unused)))
{
return NULL;
}
{NULL, 0}
};
-static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute((unused)),
+static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute__((unused)),
struct device *dev)
{
const char *name = dev_name(dev);
{
unsigned num_read = 0;
struct uuid_list *ul;
- char buffer[NAME_LEN] __attribute((aligned(8)));
+ char buffer[NAME_LEN] __attribute__((aligned(8)));
uint64_t pos = data->pvd.pv_uuidlist_on_disk.base;
uint64_t end = pos + data->pvd.pv_uuidlist_on_disk.size;
/*
* assumes the device has been opened.
*/
-static int __write_all_pvd(const struct format_type *fmt __attribute((unused)),
+static int __write_all_pvd(const struct format_type *fmt __attribute__((unused)),
struct disk_list *data)
{
const char *pv_name = dev_name(data->dev);
struct uuid_list {
struct dm_list list;
- char uuid[NAME_LEN] __attribute((aligned(8)));
+ char uuid[NAME_LEN] __attribute__((aligned(8)));
};
struct lvd_list {
struct dm_pool *mem;
struct device *dev;
- struct pv_disk pvd __attribute((aligned(8)));
- struct vg_disk vgd __attribute((aligned(8)));
- struct dm_list uuids __attribute((aligned(8)));
- struct dm_list lvds __attribute((aligned(8)));
- struct pe_disk *extents __attribute((aligned(8)));
+ struct pv_disk pvd __attribute__((aligned(8)));
+ struct vg_disk vgd __attribute__((aligned(8)));
+ struct dm_list uuids __attribute__((aligned(8)));
+ struct dm_list lvds __attribute__((aligned(8)));
+ struct pe_disk *extents __attribute__((aligned(8)));
};
/*
static struct volume_group *_format1_vg_read(struct format_instance *fid,
const char *vg_name,
- struct metadata_area *mda __attribute((unused)))
+ struct metadata_area *mda __attribute__((unused)))
{
struct dm_pool *mem = dm_pool_create("lvm1 vg_read", VG_MEMPOOL_CHUNK);
struct dm_list pvs;
}
static int _format1_vg_write(struct format_instance *fid, struct volume_group *vg,
- struct metadata_area *mda __attribute((unused)))
+ struct metadata_area *mda __attribute__((unused)))
{
struct dm_pool *mem = dm_pool_create("lvm1 vg_write", VG_MEMPOOL_CHUNK);
struct dm_list pvds;
}
static int _format1_pv_read(const struct format_type *fmt, const char *pv_name,
- struct physical_volume *pv, struct dm_list *mdas __attribute((unused)),
- int scan_label_only __attribute((unused)))
+ struct physical_volume *pv, struct dm_list *mdas __attribute__((unused)),
+ int scan_label_only __attribute__((unused)))
{
struct dm_pool *mem = dm_pool_create("lvm1 pv_read", 1024);
struct disk_list *dl;
static int _format1_pv_setup(const struct format_type *fmt,
uint64_t pe_start, uint32_t extent_count,
uint32_t extent_size,
- unsigned long data_alignment __attribute((unused)),
- unsigned long data_alignment_offset __attribute((unused)),
- int pvmetadatacopies __attribute((unused)),
- uint64_t pvmetadatasize __attribute((unused)),
- unsigned metadataignore __attribute((unused)),
- struct dm_list *mdas __attribute((unused)),
- struct physical_volume *pv, struct volume_group *vg __attribute((unused)))
+ unsigned long data_alignment __attribute__((unused)),
+ unsigned long data_alignment_offset __attribute__((unused)),
+ int pvmetadatacopies __attribute__((unused)),
+ uint64_t pvmetadatasize __attribute__((unused)),
+ unsigned metadataignore __attribute__((unused)),
+ struct dm_list *mdas __attribute__((unused)),
+ struct physical_volume *pv, struct volume_group *vg __attribute__((unused)))
{
if (pv->size > MAX_PV_SIZE)
pv->size--;
}
static int _format1_pv_write(const struct format_type *fmt, struct physical_volume *pv,
- struct dm_list *mdas __attribute((unused)), int64_t sector __attribute((unused)))
+ struct dm_list *mdas __attribute__((unused)), int64_t sector __attribute__((unused)))
{
struct dm_pool *mem;
struct disk_list *dl;
return 1;
}
-static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)),
+static int _format1_segtype_supported(struct format_instance *fid __attribute__((unused)),
const struct segment_type *segtype)
{
if (!(segtype->flags & SEG_FORMAT1_SUPPORT))
};
static struct format_instance *_format1_create_instance(const struct format_type *fmt,
- const char *vgname __attribute((unused)),
- const char *vgid __attribute((unused)),
- void *private __attribute((unused)))
+ const char *vgname __attribute__((unused)),
+ const char *vgid __attribute__((unused)),
+ void *private __attribute__((unused)))
{
struct format_instance *fid;
struct metadata_area *mda;
return fid;
}
-static void _format1_destroy_instance(struct format_instance *fid __attribute((unused)))
+static void _format1_destroy_instance(struct format_instance *fid __attribute__((unused)))
{
}
return 1;
}
-int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute((unused)),
+int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute__((unused)),
struct volume_group *vg,
struct pv_disk *pvd, struct physical_volume *pv)
{
/*
* FIXME: More inefficient code.
*/
-int import_snapshots(struct dm_pool *mem __attribute((unused)), struct volume_group *vg,
+int import_snapshots(struct dm_pool *mem __attribute__((unused)), struct volume_group *vg,
struct dm_list *pvds)
{
struct logical_volume *lvs[MAX_LV];
* This calculates the nasty pv_number field
* used by LVM1.
*/
-void export_numbers(struct dm_list *pvds, struct volume_group *vg __attribute((unused)))
+void export_numbers(struct dm_list *pvds, struct volume_group *vg __attribute__((unused)))
{
struct disk_list *dl;
int pv_num = 1;
op);
}
-static int _lvm1_can_handle(struct labeller *l __attribute((unused)), void *buf, uint64_t sector)
+static int _lvm1_can_handle(struct labeller *l __attribute__((unused)), void *buf, uint64_t sector)
{
struct pv_disk *pvd = (struct pv_disk *) buf;
uint32_t version;
return 0;
}
-static int _lvm1_write(struct label *label __attribute((unused)), void *buf __attribute((unused)))
+static int _lvm1_write(struct label *label __attribute__((unused)), void *buf __attribute__((unused)))
{
_not_supported("write");
return 0;
return 1;
}
-static int _lvm1_initialise_label(struct labeller *l __attribute((unused)), struct label *label)
+static int _lvm1_initialise_label(struct labeller *l __attribute__((unused)), struct label *label)
{
strcpy(label->type, "LVM1");
return 1;
}
-static void _lvm1_destroy_label(struct labeller *l __attribute((unused)), struct label *label __attribute((unused)))
+static void _lvm1_destroy_label(struct labeller *l __attribute__((unused)), struct label *label __attribute__((unused)))
{
}
#define CPOUT_64(x, y) {(y) = xlate64_be((x));}
static int __read_pool_disk(const struct format_type *fmt, struct device *dev,
- struct dm_pool *mem __attribute((unused)), struct pool_list *pl,
- const char *vg_name __attribute((unused)))
+ struct dm_pool *mem __attribute__((unused)), struct pool_list *pl,
+ const char *vg_name __attribute__((unused)))
{
- char buf[512] __attribute((aligned(8)));
+ char buf[512] __attribute__((aligned(8)));
/* FIXME: Need to check the cache here first */
if (!dev_read(dev, UINT64_C(0), 512, buf)) {
dm_list_iterate_items(pl, head) {
if (id_equal(&data->pv_uuid, &pl->pv_uuid)) {
- char uuid[ID_LEN + 7] __attribute((aligned(8)));
+ char uuid[ID_LEN + 7] __attribute__((aligned(8)));
id_write_format(&pl->pv_uuid, uuid, ID_LEN + 7);
struct lvmcache_info *info;
struct id pvid;
struct id vgid;
- char uuid[ID_LEN + 7] __attribute((aligned(8)));
+ char uuid[ID_LEN + 7] __attribute__((aligned(8)));
struct pool_disk *pd = &pl->pd;
pool_label_in(pd, buf);
static struct volume_group *_pool_vg_read(struct format_instance *fid,
const char *vg_name,
- struct metadata_area *mda __attribute((unused)))
+ struct metadata_area *mda __attribute__((unused)))
{
struct dm_pool *mem = dm_pool_create("pool vg_read", VG_MEMPOOL_CHUNK);
struct dm_list pds;
return NULL;
}
-static int _pool_pv_setup(const struct format_type *fmt __attribute((unused)),
- uint64_t pe_start __attribute((unused)),
- uint32_t extent_count __attribute((unused)),
- uint32_t extent_size __attribute((unused)),
- unsigned long data_alignment __attribute((unused)),
- unsigned long data_alignment_offset __attribute((unused)),
- int pvmetadatacopies __attribute((unused)),
- uint64_t pvmetadatasize __attribute((unused)),
- unsigned metadataignore __attribute((unused)),
- struct dm_list *mdas __attribute((unused)),
- struct physical_volume *pv __attribute((unused)),
- struct volume_group *vg __attribute((unused)))
+static int _pool_pv_setup(const struct format_type *fmt __attribute__((unused)),
+ uint64_t pe_start __attribute__((unused)),
+ uint32_t extent_count __attribute__((unused)),
+ uint32_t extent_size __attribute__((unused)),
+ unsigned long data_alignment __attribute__((unused)),
+ unsigned long data_alignment_offset __attribute__((unused)),
+ int pvmetadatacopies __attribute__((unused)),
+ uint64_t pvmetadatasize __attribute__((unused)),
+ unsigned metadataignore __attribute__((unused)),
+ struct dm_list *mdas __attribute__((unused)),
+ struct physical_volume *pv __attribute__((unused)),
+ struct volume_group *vg __attribute__((unused)))
{
return 1;
}
static int _pool_pv_read(const struct format_type *fmt, const char *pv_name,
struct physical_volume *pv,
- struct dm_list *mdas __attribute((unused)),
- int scan_label_only __attribute((unused)))
+ struct dm_list *mdas __attribute__((unused)),
+ int scan_label_only __attribute__((unused)))
{
struct dm_pool *mem = dm_pool_create("pool pv_read", 1024);
struct pool_list *pl;
/* *INDENT-ON* */
static struct format_instance *_pool_create_instance(const struct format_type *fmt,
- const char *vgname __attribute((unused)),
- const char *vgid __attribute((unused)),
- void *private __attribute((unused)))
+ const char *vgname __attribute__((unused)),
+ const char *vgid __attribute__((unused)),
+ void *private __attribute__((unused)))
{
struct format_instance *fid;
struct metadata_area *mda;
return fid;
}
-static void _pool_destroy_instance(struct format_instance *fid __attribute((unused)))
+static void _pool_destroy_instance(struct format_instance *fid __attribute__((unused)))
{
}
op);
}
-static int _pool_can_handle(struct labeller *l __attribute((unused)), void *buf, uint64_t sector)
+static int _pool_can_handle(struct labeller *l __attribute__((unused)), void *buf, uint64_t sector)
{
struct pool_disk pd;
return 0;
}
-static int _pool_write(struct label *label __attribute((unused)), void *buf __attribute((unused)))
+static int _pool_write(struct label *label __attribute__((unused)), void *buf __attribute__((unused)))
{
_pool_not_supported("write");
return 0;
return read_pool_label(&pl, l, dev, buf, label);
}
-static int _pool_initialise_label(struct labeller *l __attribute((unused)), struct label *label)
+static int _pool_initialise_label(struct labeller *l __attribute__((unused)), struct label *label)
{
strcpy(label->type, "POOL");
return 1;
}
-static void _pool_destroy_label(struct labeller *l __attribute((unused)), struct label *label __attribute((unused)))
+static void _pool_destroy_label(struct labeller *l __attribute__((unused)), struct label *label __attribute__((unused)))
{
}
}
static int _out_with_comment_raw(struct formatter *f,
- const char *comment __attribute((unused)),
+ const char *comment __attribute__((unused)),
const char *fmt, va_list ap)
{
int n;
static const char *_get_pv_name(struct formatter *f, struct physical_volume *pv)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!pv || !id_write_format(&pv->id, uuid, sizeof(uuid)))
return_NULL;
* NOTE: Currently there can be only one vg per text file.
*/
-static int _text_vg_setup(struct format_instance *fid __attribute((unused)),
+static int _text_vg_setup(struct format_instance *fid __attribute__((unused)),
struct volume_group *vg)
{
if (vg->extent_size & (vg->extent_size - 1)) {
/*
* Check if metadata area belongs to vg
*/
-static int _mda_in_vg_raw(struct format_instance *fid __attribute((unused)),
+static int _mda_in_vg_raw(struct format_instance *fid __attribute__((unused)),
struct volume_group *vg, struct metadata_area *mda)
{
struct mda_context *mdac = (struct mda_context *) mda->metadata_locn;
-static int _text_lv_setup(struct format_instance *fid __attribute((unused)),
+static int _text_lv_setup(struct format_instance *fid __attribute__((unused)),
struct logical_volume *lv)
{
/******** FIXME Any LV size restriction?
int *precommitted)
{
size_t len;
- char vgnamebuf[NAME_LEN + 2] __attribute((aligned(8)));
+ char vgnamebuf[NAME_LEN + 2] __attribute__((aligned(8)));
struct raw_locn *rlocn, *rlocn_precommitted;
struct lvmcache_info *info;
return vg;
}
-static int _vg_write_file(struct format_instance *fid __attribute((unused)),
+static int _vg_write_file(struct format_instance *fid __attribute__((unused)),
struct volume_group *vg, struct metadata_area *mda)
{
struct text_context *tc = (struct text_context *) mda->metadata_locn;
return 1;
}
-static int _vg_commit_file_backup(struct format_instance *fid __attribute((unused)),
+static int _vg_commit_file_backup(struct format_instance *fid __attribute__((unused)),
struct volume_group *vg,
struct metadata_area *mda)
{
return 1;
}
-static int _vg_remove_file(struct format_instance *fid __attribute((unused)),
- struct volume_group *vg __attribute((unused)),
+static int _vg_remove_file(struct format_instance *fid __attribute__((unused)),
+ struct volume_group *vg __attribute__((unused)),
struct metadata_area *mda)
{
struct text_context *tc = (struct text_context *) mda->metadata_locn;
uint32_t wrap = 0;
const char *vgname = NULL;
unsigned int len = 0;
- char buf[NAME_LEN + 1] __attribute((aligned(8)));
- char uuid[64] __attribute((aligned(8)));
+ char buf[NAME_LEN + 1] __attribute__((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
uint64_t buffer_size, current_usage;
if (mda_free_sectors)
int pvmetadatacopies, uint64_t pvmetadatasize,
unsigned metadataignore, struct dm_list *mdas,
struct physical_volume *pv,
- struct volume_group *vg __attribute((unused)))
+ struct volume_group *vg __attribute__((unused)))
{
uint64_t mda_adjustment, disk_size, alignment, alignment_offset;
uint64_t start1, mda_size1; /* First area - start of disk */
struct lvmcache_info *info;
struct mda_context *mdac;
struct metadata_area *mda;
- char buf[MDA_HEADER_SIZE] __attribute((aligned(8)));
+ char buf[MDA_HEADER_SIZE] __attribute__((aligned(8)));
struct mda_header *mdah = (struct mda_header *) buf;
uint64_t adjustment;
struct data_area_list *da;
return 1;
}
-static void _text_destroy_instance(struct format_instance *fid __attribute((unused)))
+static void _text_destroy_instance(struct format_instance *fid __attribute__((unused)))
{
}
}
if (!(dev_area.dev = device_from_pvid(cmd, &id, NULL))) {
- char buffer[64] __attribute((aligned(8)));
+ char buffer[64] __attribute__((aligned(8)));
if (!id_write_format(&id, buffer, sizeof(buffer)))
log_error("Couldn't find device.");
static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
struct volume_group *vg, struct config_node *pvn,
- struct config_node *vgn __attribute((unused)),
+ struct config_node *vgn __attribute__((unused)),
struct dm_hash_table *pv_hash,
- struct dm_hash_table *lv_hash __attribute((unused)),
+ struct dm_hash_table *lv_hash __attribute__((unused)),
unsigned *scan_done_once,
unsigned report_missing_devices)
{
* Convert the uuid into a device.
*/
if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id, scan_done_once))) {
- char buffer[64] __attribute((aligned(8)));
+ char buffer[64] __attribute__((aligned(8)));
if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
buffer[0] = '\0';
return 1;
}
-static int _read_lvnames(struct format_instance *fid __attribute((unused)),
+static int _read_lvnames(struct format_instance *fid __attribute__((unused)),
struct dm_pool *mem,
struct volume_group *vg, struct config_node *lvn,
- struct config_node *vgn __attribute((unused)),
- struct dm_hash_table *pv_hash __attribute((unused)),
+ struct config_node *vgn __attribute__((unused)),
+ struct dm_hash_table *pv_hash __attribute__((unused)),
struct dm_hash_table *lv_hash,
- unsigned *scan_done_once __attribute((unused)),
- unsigned report_missing_devices __attribute((unused)))
+ unsigned *scan_done_once __attribute__((unused)),
+ unsigned report_missing_devices __attribute__((unused)))
{
struct logical_volume *lv;
struct config_node *cn;
return link_lv_to_vg(vg, lv);
}
-static int _read_lvsegs(struct format_instance *fid __attribute((unused)),
+static int _read_lvsegs(struct format_instance *fid __attribute__((unused)),
struct dm_pool *mem,
struct volume_group *vg, struct config_node *lvn,
- struct config_node *vgn __attribute((unused)),
+ struct config_node *vgn __attribute__((unused)),
struct dm_hash_table *pv_hash,
struct dm_hash_table *lv_hash,
- unsigned *scan_done_once __attribute((unused)),
- unsigned report_missing_devices __attribute((unused)))
+ unsigned *scan_done_once __attribute__((unused)),
+ unsigned report_missing_devices __attribute__((unused)))
{
struct logical_volume *lv;
#include <sys/stat.h>
#include <fcntl.h>
-static int _text_can_handle(struct labeller *l __attribute((unused)),
+static int _text_can_handle(struct labeller *l __attribute__((unused)),
void *buf,
- uint64_t sector __attribute((unused)))
+ uint64_t sector __attribute__((unused)))
{
struct label_header *lh = (struct label_header *) buf;
struct metadata_area *mda;
struct mda_context *mdac;
struct data_area_list *da;
- char buffer[64] __attribute((aligned(8)));
+ char buffer[64] __attribute__((aligned(8)));
int da1, mda1, mda2;
/* FIXME Move to where label is created */
}
}
-static int _text_initialise_label(struct labeller *l __attribute((unused)),
+static int _text_initialise_label(struct labeller *l __attribute__((unused)),
struct label *label)
{
strncpy(label->type, LVM2_LABEL, sizeof(label->type));
return 1;
}
-static void _text_destroy_label(struct labeller *l __attribute((unused)),
+static void _text_destroy_label(struct labeller *l __attribute__((unused)),
struct label *label)
{
struct lvmcache_info *info = (struct lvmcache_info *) label->info;
struct lvmcache_info *info;
uint64_t sector;
int found = 0;
- char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8)));
+ char readbuf[LABEL_SCAN_SIZE] __attribute__((aligned(8)));
if (!dev_read(dev, scan_sector << SECTOR_SHIFT,
LABEL_SCAN_SIZE, readbuf)) {
/* FIXME Also wipe associated metadata area headers? */
int label_remove(struct device *dev)
{
- char buf[LABEL_SIZE] __attribute((aligned(8)));
- char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8)));
+ char buf[LABEL_SIZE] __attribute__((aligned(8)));
+ char readbuf[LABEL_SCAN_SIZE] __attribute__((aligned(8)));
int r = 1;
uint64_t sector;
int wipe;
int label_read(struct device *dev, struct label **result,
uint64_t scan_sector)
{
- char buf[LABEL_SIZE] __attribute((aligned(8)));
+ char buf[LABEL_SIZE] __attribute__((aligned(8)));
struct labeller *l;
uint64_t sector;
struct lvmcache_info *info;
/* Caller may need to use label_get_handler to create label struct! */
int label_write(struct device *dev, struct label *label)
{
- char buf[LABEL_SIZE] __attribute((aligned(8)));
+ char buf[LABEL_SIZE] __attribute__((aligned(8)));
struct label_header *lh = (struct label_header *) buf;
int r = 1;
int label_verify(struct device *dev)
{
struct labeller *l;
- char buf[LABEL_SIZE] __attribute((aligned(8)));
+ char buf[LABEL_SIZE] __attribute__((aligned(8)));
uint64_t sector;
struct lvmcache_info *info;
int r = 0;
/* Send a request and return the status */
static int _send_request(char *inbuf, int inlen, char **retbuf)
{
- char outbuf[PIPE_BUF] __attribute((aligned(8)));
+ char outbuf[PIPE_BUF] __attribute__((aligned(8)));
struct clvm_header *outheader = (struct clvm_header *) outbuf;
int len;
int off;
static int _cluster_request(char clvmd_cmd, const char *node, void *data, int len,
lvm_response_t ** response, int *num)
{
- char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1] __attribute((aligned(8)));
+ char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1] __attribute__((aligned(8)));
char *inptr;
char *retbuf = NULL;
int status;
log_sys_error("signal", "_remove_ctrl_c_handler");
}
-static void _trap_ctrl_c(int sig __attribute((unused)))
+static void _trap_ctrl_c(int sig __attribute__((unused)))
{
_remove_ctrl_c_handler();
log_error("CTRL-c detected: giving up waiting for lock");
sigaction(SIGINT, &_oldhandler, NULL);
}
-static void _block_signals(uint32_t flags __attribute((unused)))
+static void _block_signals(uint32_t flags __attribute__((unused)))
{
sigset_t set;
int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags)
{
- char resource[258] __attribute((aligned(8)));
+ char resource[258] __attribute__((aligned(8)));
lv_operation_t lv_op;
switch (flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) {
return _no_lock_resource(cmd, resource, flags);
}
-int init_no_locking(struct locking_type *locking, struct cmd_context *cmd __attribute((unused)))
+int init_no_locking(struct locking_type *locking, struct cmd_context *cmd __attribute__((unused)))
{
locking->lock_resource = _no_lock_resource;
locking->reset_locking = _no_reset_locking;
return 1;
}
-int init_readonly_locking(struct locking_type *locking, struct cmd_context *cmd __attribute((unused)))
+int init_readonly_locking(struct locking_type *locking, struct cmd_context *cmd __attribute__((unused)))
{
locking->lock_resource = _readonly_lock_resource;
locking->reset_locking = _no_reset_locking;
return 1;
}
-static int _is_condition(struct cmd_context *cmd __attribute((unused)),
+static int _is_condition(struct cmd_context *cmd __attribute__((unused)),
struct pv_segment *pvseg, uint32_t s,
void *data)
{
const struct segment_type *segtype,
uint32_t stripes, uint32_t stripe_size,
uint32_t mirrors, uint32_t extents,
- struct physical_volume *mirrored_pv __attribute((unused)),
- uint32_t mirrored_pe __attribute((unused)),
+ struct physical_volume *mirrored_pv __attribute__((unused)),
+ uint32_t mirrored_pe __attribute__((unused)),
uint64_t status, struct dm_list *allocatable_pvs,
alloc_policy_t alloc)
{
}
static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg,
- uint32_t s __attribute((unused)), void *data)
+ uint32_t s __attribute__((unused)), void *data)
{
struct seg_pvs *spvs = (struct seg_pvs *) data;
struct pv_list *pvl;
struct pv_list *pvl;
struct format_instance *fid = vg->fid;
struct dm_pool *mem = vg->vgmem;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
struct dm_list *mdas;
log_verbose("Adding physical volume '%s' to volume group '%s'",
* Separate metadata areas after splitting a VG.
* Also accepts orphan VG as destination (for vgreduce).
*/
-int vg_split_mdas(struct cmd_context *cmd __attribute((unused)),
+int vg_split_mdas(struct cmd_context *cmd __attribute__((unused)),
struct volume_group *vg_from, struct volume_group *vg_to)
{
struct dm_list *mdas_from_in_use, *mdas_to_in_use;
struct device *dev;
struct dm_list mdas;
struct pvcreate_params default_pp;
- char buffer[64] __attribute((aligned(8)));
+ char buffer[64] __attribute__((aligned(8)));
pvcreate_params_set_defaults(&default_pp);
if (!pp)
/*
* Determine whether two vgs are compatible for merging.
*/
-int vgs_are_compatible(struct cmd_context *cmd __attribute((unused)),
+int vgs_are_compatible(struct cmd_context *cmd __attribute__((unused)),
struct volume_group *vg_from,
struct volume_group *vg_to)
{
{
struct pv_list *pvl, *pvl2;
struct lv_list *lvl, *lvl2;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
int r = 1;
uint32_t hidden_lv_count = 0, lv_count = 0, lv_visible_count = 0;
uint32_t pv_count = 0;
struct dm_list *pvids;
struct pv_list *pvl, *pvl2;
struct dm_list all_pvs;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (is_orphan_vg(vgname)) {
if (use_precommitted) {
return _get_pvs(cmd, NULL);
}
-int pv_write(struct cmd_context *cmd __attribute((unused)),
+int pv_write(struct cmd_context *cmd __attribute__((unused)),
struct physical_volume *pv,
struct dm_list *mdas, int64_t label_sector)
{
return 1;
}
-static int _no_removable_images(struct logical_volume *lv __attribute((unused)),
- void *baton __attribute((unused))) {
+static int _no_removable_images(struct logical_volume *lv __attribute__((unused)),
+ void *baton __attribute__((unused))) {
return 0;
}
return 1;
}
-static int get_mirror_fault_policy(struct cmd_context *cmd __attribute((unused)),
+static int get_mirror_fault_policy(struct cmd_context *cmd __attribute__((unused)),
int log_policy)
{
const char *policy;
struct logical_volume *find_pvmove_lv_from_pvname(struct cmd_context *cmd,
struct volume_group *vg,
const char *name,
- const char *uuid __attribute((unused)),
+ const char *uuid __attribute__((unused)),
uint32_t lv_type)
{
struct physical_volume *pv;
* 'mirror' is the number of mirrors to be removed.
* 'pvs' is removable pvs.
*/
-int lv_remove_mirrors(struct cmd_context *cmd __attribute((unused)),
+int lv_remove_mirrors(struct cmd_context *cmd __attribute__((unused)),
struct logical_volume *lv,
uint32_t mirrors, uint32_t log_count,
int (*is_removable)(struct logical_volume *, void *),
/* FIXME This gets run while suspended and performs banned operations. */
static int _target_set_events(struct lv_segment *seg,
- int evmask __attribute((unused)), int set)
+ int evmask __attribute__((unused)), int set)
{
char *dso, *uuid;
struct logical_volume *lv;
/* Import replicator segment */
static int _replicator_text_import(struct lv_segment *seg,
const struct config_node *sn,
- struct dm_hash_table *pv_hash __attribute((unused)))
+ struct dm_hash_table *pv_hash __attribute__((unused)))
{
const struct config_node *cn;
struct logical_volume *rlog_lv;
/* Check for module presence */
static int _replicator_target_present(struct cmd_context *cmd,
- const struct lv_segment *seg __attribute((unused)),
- unsigned *attributes __attribute((unused)))
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes __attribute__((unused)))
{
static int _checked = 0;
static int _present = 0;
#endif
static int _replicator_modules_needed(struct dm_pool *mem,
- const struct lv_segment *seg __attribute((unused)),
+ const struct lv_segment *seg __attribute__((unused)),
struct dm_list *modules)
{
if (!str_list_add(mem, modules, REPLICATOR_MODULE))
/* Import replicator segment */
static int _replicator_dev_text_import(struct lv_segment *seg,
const struct config_node *sn,
- struct dm_hash_table *pv_hash __attribute((unused)))
+ struct dm_hash_table *pv_hash __attribute__((unused)))
{
const struct config_node *cn;
struct logical_volume *replicator;
/* Check for module presence */
static int _replicator_dev_target_present(struct cmd_context *cmd,
- const struct lv_segment *seg __attribute((unused)),
- unsigned *attributes __attribute((unused)))
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes __attribute__((unused)))
{
static int _checked = 0;
static int _present = 0;
/*
* Data-munging functions to prepare each data type for display and sorting
*/
-static int _string_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _string_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
return dm_report_field_string(rh, field, (const char **) data);
}
-static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const char *name = dev_name(*(const struct device * const *) data);
return 1;
}
-static int _devices_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _devices_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
return _format_pvsegs(mem, field, data, 0);
}
-static int _peranges_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _peranges_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
return _format_pvsegs(mem, field, data, 1);
}
-static int _tags_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _tags_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct dm_list *tags = (const struct dm_list *) data;
struct str_list *sl;
return _string_disp(rh, mem, field, &pv->fmt->name, private);
}
-static int _lvkmaj_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _lvkmaj_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
struct lvinfo info;
return dm_report_field_int32(rh, field, &_minusone32);
}
-static int _lvkmin_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _lvkmin_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
struct lvinfo info;
return (percent_range == PERCENT_100) ? 1 : 0;
}
-static int _lvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _lvstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
struct lvinfo info;
return 1;
}
-static int _pvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _pvstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const uint32_t status = *(const uint32_t *) data;
char *repstr;
return 1;
}
-static int _vgstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _vgstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct volume_group *vg = (const struct volume_group *) data;
char *repstr;
return 1;
}
-static int _segtype_disp(struct dm_report *rh __attribute((unused)),
- struct dm_pool *mem __attribute((unused)),
+static int _segtype_disp(struct dm_report *rh __attribute__((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct lv_segment *seg = (const struct lv_segment *) data;
return 1;
}
-static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
struct lv_segment *seg;
static int _lvname_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
char *repstr, *lvname;
static int _lvpath_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
char *repstr;
return 1;
}
-static int _movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
const char *name;
return 1;
}
-static int _convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
const char *name = NULL;
return 1;
}
-static int _size32_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _size32_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
return 1;
}
-static int _size64_disp(struct dm_report *rh __attribute((unused)),
+static int _size64_disp(struct dm_report *rh __attribute__((unused)),
struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
static int _lvreadahead_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
}
static int _segstartpe_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const struct lv_segment *seg = (const struct lv_segment *) data;
return _size64_disp(rh, mem, field, &freespace, private);
}
-static int _uuid_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _uuid_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
char *repstr = NULL;
return 1;
}
-static int _uint32_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _uint32_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
return dm_report_field_uint32(rh, field, data);
}
-static int _int32_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
+static int _int32_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
return dm_report_field_int32(rh, field, data);
}
return _uint32_disp(rh, mem, field, &count, private);
}
-static int _snpercent_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem,
+static int _snpercent_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
struct lvinfo info;
return 1;
}
-static int _copypercent_disp(struct dm_report *rh __attribute((unused)),
+static int _copypercent_disp(struct dm_report *rh __attribute__((unused)),
struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
struct logical_volume *lv = (struct logical_volume *) data;
float percent;
}
static int _snap_text_import(struct lv_segment *seg, const struct config_node *sn,
- struct dm_hash_table *pv_hash __attribute((unused)))
+ struct dm_hash_table *pv_hash __attribute__((unused)))
{
uint32_t chunk_size;
const char *org_name, *cow_name;
}
#ifdef DEVMAPPER_SUPPORT
-static int _snap_target_percent(void **target_state __attribute((unused)),
+static int _snap_target_percent(void **target_state __attribute__((unused)),
percent_range_t *percent_range,
- struct dm_pool *mem __attribute((unused)),
- struct cmd_context *cmd __attribute((unused)),
- struct lv_segment *seg __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
+ struct cmd_context *cmd __attribute__((unused)),
+ struct lv_segment *seg __attribute__((unused)),
char *params, uint64_t *total_numerator,
uint64_t *total_denominator)
{
static int _snap_target_present(struct cmd_context *cmd,
const struct lv_segment *seg,
- unsigned *attributes __attribute((unused)))
+ unsigned *attributes __attribute__((unused)))
{
static int _snap_checked = 0;
static int _snap_merge_checked = 0;
/* FIXME This gets run while suspended and performs banned operations. */
static int _target_set_events(struct lv_segment *seg,
- int events __attribute((unused)), int set)
+ int events __attribute__((unused)), int set)
{
char *dso, *uuid;
struct volume_group *vg = seg->lv->vg;
#endif
static int _snap_modules_needed(struct dm_pool *mem,
- const struct lv_segment *seg __attribute((unused)),
+ const struct lv_segment *seg __attribute__((unused)),
struct dm_list *modules)
{
if (!str_list_add(mem, modules, "snapshot")) {
#ifdef DEVMAPPER_SUPPORT
static int _striped_add_target_line(struct dev_manager *dm,
- struct dm_pool *mem __attribute((unused)),
- struct cmd_context *cmd __attribute((unused)),
- void **target_state __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
+ struct cmd_context *cmd __attribute__((unused)),
+ void **target_state __attribute__((unused)),
struct lv_segment *seg,
struct dm_tree_node *node, uint64_t len,
- uint32_t *pvmove_mirror_count __attribute((unused)))
+ uint32_t *pvmove_mirror_count __attribute__((unused)))
{
if (!seg->area_count) {
log_error(INTERNAL_ERROR "striped add_target_line called "
}
static int _striped_target_present(struct cmd_context *cmd,
- const struct lv_segment *seg __attribute((unused)),
- unsigned *attributes __attribute((unused)))
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes __attribute__((unused)))
{
static int _striped_checked = 0;
static int _striped_present = 0;
}
#ifdef DEVMAPPER_SUPPORT
-static int _unknown_add_target_line(struct dev_manager *dm __attribute((unused)),
- struct dm_pool *mem __attribute((unused)),
- struct cmd_context *cmd __attribute((unused)),
- void **target_state __attribute((unused)),
- struct lv_segment *seg __attribute((unused)),
+static int _unknown_add_target_line(struct dev_manager *dm __attribute__((unused)),
+ struct dm_pool *mem __attribute__((unused)),
+ struct cmd_context *cmd __attribute__((unused)),
+ void **target_state __attribute__((unused)),
+ struct lv_segment *seg __attribute__((unused)),
struct dm_tree_node *node, uint64_t len,
- uint32_t *pvmove_mirror_count __attribute((unused)))
+ uint32_t *pvmove_mirror_count __attribute__((unused)))
{
return dm_tree_node_add_error_target(node, len);
}
}
#ifdef DEVMAPPER_SUPPORT
-static int _zero_add_target_line(struct dev_manager *dm __attribute((unused)),
- struct dm_pool *mem __attribute((unused)),
- struct cmd_context *cmd __attribute((unused)),
- void **target_state __attribute((unused)),
- struct lv_segment *seg __attribute((unused)),
+static int _zero_add_target_line(struct dev_manager *dm __attribute__((unused)),
+ struct dm_pool *mem __attribute__((unused)),
+ struct cmd_context *cmd __attribute__((unused)),
+ void **target_state __attribute__((unused)),
+ struct lv_segment *seg __attribute__((unused)),
struct dm_tree_node *node,uint64_t len,
- uint32_t *pvmove_mirror_count __attribute((unused)))
+ uint32_t *pvmove_mirror_count __attribute__((unused)))
{
return dm_tree_node_add_zero_target(node, len);
}
static int _zero_target_present(struct cmd_context *cmd,
- const struct lv_segment *seg __attribute((unused)),
- unsigned *attributes __attribute((unused)))
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes __attribute__((unused)))
{
static int _zero_checked = 0;
static int _zero_present = 0;
#endif
static int _zero_modules_needed(struct dm_pool *mem,
- const struct lv_segment *seg __attribute((unused)),
+ const struct lv_segment *seg __attribute__((unused)),
struct dm_list *modules)
{
if (!str_list_add(mem, modules, "zero")) {
t->num_nodes = 0u;
}
-char *dm_hash_get_key(struct dm_hash_table *t __attribute((unused)),
+char *dm_hash_get_key(struct dm_hash_table *t __attribute__((unused)),
struct dm_hash_node *n)
{
return n->key;
}
-void *dm_hash_get_data(struct dm_hash_table *t __attribute((unused)),
+void *dm_hash_get_data(struct dm_hash_table *t __attribute__((unused)),
struct dm_hash_node *n)
{
return n->data;
* Release library resources
*/
void dm_lib_release(void);
-void dm_lib_exit(void) __attribute((destructor));
+void dm_lib_exit(void) __attribute__((destructor));
/*
* Use NULL for all devices.
*/
static void _default_log_line(int level,
- const char *file __attribute((unused)),
- int line __attribute((unused)), int dm_errno,
+ const char *file __attribute__((unused)),
+ int line __attribute__((unused)), int dm_errno,
const char *f, va_list ap)
{
int use_stderr = level & _LOG_STDERR;
}
static void _default_log_with_errno(int level,
- const char *file __attribute((unused)),
- int line __attribute((unused)), int dm_errno,
+ const char *file __attribute__((unused)),
+ int line __attribute__((unused)), int dm_errno,
const char *f, ...)
{
va_list ap;
*
* Returns: 1 on success, 0 on failure
*/
-static int _emit_areas_line(struct dm_task *dmt __attribute((unused)),
+static int _emit_areas_line(struct dm_task *dmt __attribute__((unused)),
struct load_segment *seg, char *params,
size_t paramsize, int *pos)
{
* Returns number of words.
*/
int dm_split_words(char *buffer, unsigned max,
- unsigned ignore_comments __attribute((unused)),
+ unsigned ignore_comments __attribute__((unused)),
char **argv)
{
unsigned arg;
}
}
-void *dm_malloc_aux(size_t s, const char *file __attribute((unused)),
- int line __attribute((unused)))
+void *dm_malloc_aux(size_t s, const char *file __attribute__((unused)),
+ int line __attribute__((unused)))
{
if (s > 50000000) {
log_error("Huge memory allocation (size %" PRIsize_t
const char *lvm_lv_get_uuid(const lv_t lv)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid))) {
log_error(INTERNAL_ERROR "unable to convert uuid");
const char *lvm_pv_get_uuid(const pv_t pv)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!id_write_format(&pv->id, uuid, sizeof(uuid))) {
log_error(INTERNAL_ERROR "Unable to convert uuid");
const char *lvm_vg_get_uuid(const vg_t vg)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (!id_write_format(&vg->id, uuid, sizeof(uuid))) {
log_error(INTERNAL_ERROR "Unable to convert uuid");
return 1;
}
-static int _load(int argc, char **argv, void *data __attribute((unused)))
+static int _load(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0;
struct dm_task *dmt;
return r;
}
-static int _create(int argc, char **argv, void *data __attribute((unused)))
+static int _create(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0;
struct dm_task *dmt;
return r;
}
-static int _rename(int argc, char **argv, void *data __attribute((unused)))
+static int _rename(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0;
struct dm_task *dmt;
return r;
}
-static int _message(int argc, char **argv, void *data __attribute((unused)))
+static int _message(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0, i;
size_t sz = 1;
return r;
}
-static int _setgeometry(int argc, char **argv, void *data __attribute((unused)))
+static int _setgeometry(int argc, char **argv, void *data __attribute__((unused)))
{
int r = 0;
struct dm_task *dmt;
return r;
}
-static int _splitname(int argc, char **argv, void *data __attribute((unused)))
+static int _splitname(int argc, char **argv, void *data __attribute__((unused)))
{
struct dmsetup_report_obj obj;
int r = 1;
return (uint32_t) value;
}
-static int _udevflags(int args, char **argv, void *data __attribute((unused)))
+static int _udevflags(int args, char **argv, void *data __attribute__((unused)))
{
uint32_t cookie;
uint16_t flags;
return 1;
}
-static int _udevcomplete(int argc, char **argv, void *data __attribute((unused)))
+static int _udevcomplete(int argc, char **argv, void *data __attribute__((unused)))
{
uint32_t cookie;
static const char _cmd_not_supported[] = "Command not supported. Recompile with \"--enable-udev-sync\" to enable.";
static int _udevcreatecookie(int argc, char **argv,
- void *data __attribute((unused)))
+ void *data __attribute__((unused)))
{
log_error(_cmd_not_supported);
}
static int _udevreleasecookie(int argc, char **argv,
- void *data __attribute((unused)))
+ void *data __attribute__((unused)))
{
log_error(_cmd_not_supported);
return 0;
}
-static int _udevcomplete_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _udevcomplete_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
log_error(_cmd_not_supported);
return 0;
}
-static int _udevcookies(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _udevcookies(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
log_error(_cmd_not_supported);
}
static int _udevcreatecookie(int argc, char **argv,
- void *data __attribute((unused)))
+ void *data __attribute__((unused)))
{
uint32_t cookie;
}
static int _udevreleasecookie(int argc, char **argv,
- void *data __attribute((unused)))
+ void *data __attribute__((unused)))
{
if (argv[1] && !(_udev_cookie = _get_cookie_value(argv[1])))
return 0;
return ret;
}
-static int _udevcomplete_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _udevcomplete_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
int max_id, id, sid;
struct seminfo sinfo;
return 1;
}
-static int _udevcookies(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _udevcookies(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
int max_id, id, sid;
struct seminfo sinfo;
}
#endif /* UDEV_SYNC_SUPPORT */
-static int _version(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _version(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
char version[80];
return r;
}
-static int _suspend(int argc, char **argv, void *data __attribute((unused)))
+static int _suspend(int argc, char **argv, void *data __attribute__((unused)))
{
return _simple(DM_DEVICE_SUSPEND, argc > 1 ? argv[1] : NULL, 0, 1);
}
-static int _resume(int argc, char **argv, void *data __attribute((unused)))
+static int _resume(int argc, char **argv, void *data __attribute__((unused)))
{
return _simple(DM_DEVICE_RESUME, argc > 1 ? argv[1] : NULL, 0, 1);
}
-static int _clear(int argc, char **argv, void *data __attribute((unused)))
+static int _clear(int argc, char **argv, void *data __attribute__((unused)))
{
return _simple(DM_DEVICE_CLEAR, argc > 1 ? argv[1] : NULL, 0, 1);
}
-static int _wait(int argc, char **argv, void *data __attribute((unused)))
+static int _wait(int argc, char **argv, void *data __attribute__((unused)))
{
const char *name = NULL;
return size;
}
-static int _error_device(int argc __attribute((unused)), char **argv __attribute((unused)), void *data)
+static int _error_device(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data)
{
struct dm_names *names = (struct dm_names *) data;
struct dm_task *dmt;
return r;
}
-static int _remove(int argc, char **argv, void *data __attribute((unused)))
+static int _remove(int argc, char **argv, void *data __attribute__((unused)))
{
int r;
return _simple(DM_DEVICE_REMOVE, argc > 1 ? argv[1] : NULL, 0, 0);
}
-static int _count_devices(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _count_devices(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
_num_devices++;
return 1;
}
-static int _remove_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _remove_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
int r;
printf("%s\t(%u, %u)\n", name, info.major, info.minor);
}
-static int _mknodes(int argc, char **argv, void *data __attribute((unused)))
+static int _mknodes(int argc, char **argv, void *data __attribute__((unused)))
{
return dm_mknodes(argc > 1 ? argv[1] : NULL);
}
}
/* Show target names and their version numbers */
-static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+static int _targets(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused)))
{
int r = 0;
struct dm_task *dmt;
return r;
}
-static int _display_name(int argc __attribute((unused)), char **argv __attribute((unused)), void *data)
+static int _display_name(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data)
{
struct dm_names *names = (struct dm_names *) data;
}
static void _display_tree_node(struct dm_tree_node *node, unsigned depth,
- unsigned first_child __attribute((unused)),
+ unsigned first_child __attribute__((unused)),
unsigned last_child, unsigned has_children)
{
int offset;
}
}
-static int _add_dep(int argc __attribute((unused)), char **argv __attribute((unused)), void *data)
+static int _add_dep(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data)
{
struct dm_names *names = (struct dm_names *) data;
return 1;
}
-static int _display_tree(int argc __attribute((unused)),
- char **argv __attribute((unused)),
- void *data __attribute((unused)))
+static int _display_tree(int argc __attribute__((unused)),
+ char **argv __attribute__((unused)),
+ void *data __attribute__((unused)))
{
if (!_build_whole_deptree())
return 0;
/* dm specific display functions */
static int _int32_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const int32_t value = *(const int32_t *)data;
}
static int _uint32_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const uint32_t value = *(const int32_t *)data;
}
static int _dm_name_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const char *name = dm_task_get_name((const struct dm_task *) data);
}
static int _dm_uuid_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
- const void *data, void *private __attribute((unused)))
+ const void *data, void *private __attribute__((unused)))
{
const char *uuid = dm_task_get_uuid((const struct dm_task *) data);
}
static int _dm_read_ahead_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
uint32_t value;
}
static int _dm_info_status_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
char buf[5];
const char *s = buf;
}
static int _dm_info_table_loaded_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const struct dm_info *info = data;
}
static int _dm_info_suspended_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const struct dm_info *info = data;
}
static int _dm_info_read_only_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field,
const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
const struct dm_info *info = data;
}
static int _dm_subsystem_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
return dm_report_field_string(rh, field, (const char **) data);
}
static int _dm_vg_name_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
return dm_report_field_string(rh, field, (const char **) data);
}
static int _dm_lv_name_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
return dm_report_field_string(rh, field, (const char **) data);
}
static int _dm_lv_layer_name_disp(struct dm_report *rh,
- struct dm_pool *mem __attribute((unused)),
+ struct dm_pool *mem __attribute__((unused)),
struct dm_report_field *field, const void *data,
- void *private __attribute((unused)))
+ void *private __attribute__((unused)))
{
return dm_report_field_string(rh, field, (const char **) data);
"[-o offset] [-f|loop_device] [file]\n\n");
}
-static int _help(int argc __attribute((unused)),
- char **argv __attribute((unused)),
- void *data __attribute((unused)))
+static int _help(int argc __attribute__((unused)),
+ char **argv __attribute__((unused)),
+ void *data __attribute__((unused)))
{
_usage(stderr);
* create a table for a mapped device using the loop target.
*/
static int _loop_table(char *table, size_t tlen, char *file,
- char *dev __attribute((unused)), off_t off)
+ char *dev __attribute__((unused)), off_t off)
{
struct stat fbuf;
off_t size, sectors;
#include "tools.h"
-int formats(struct cmd_context *cmd, int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int formats(struct cmd_context *cmd, int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
display_formats(cmd);
}
static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
int doit = 0, docmds = 0;
int dmeventd_mode, archived = 0;
static struct volume_group *_get_lvconvert_vg(struct cmd_context *cmd,
const char *name,
- const char *uuid __attribute((unused)))
+ const char *uuid __attribute__((unused)))
{
dev_close_all();
NULL, 0);
}
-static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attribute((unused)),
+static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attribute__((unused)),
struct volume_group *vg,
const char *name,
const char *uuid,
- uint32_t lv_type __attribute((unused)))
+ uint32_t lv_type __attribute__((unused)))
{
struct logical_volume *lv = find_lv(vg, name);
static int _finish_lvconvert_mirror(struct cmd_context *cmd,
struct volume_group *vg,
struct logical_volume *lv,
- struct dm_list *lvs_changed __attribute((unused)))
+ struct dm_list *lvs_changed __attribute__((unused)))
{
int r = 0;
static int _finish_lvconvert_merge(struct cmd_context *cmd,
struct volume_group *vg,
struct logical_volume *lv,
- struct dm_list *lvs_changed __attribute((unused)))
+ struct dm_list *lvs_changed __attribute__((unused)))
{
struct lv_segment *snap_seg = find_merging_cow(lv);
if (!snap_seg) {
static progress_t _poll_merge_progress(struct cmd_context *cmd,
struct logical_volume *lv,
- const char *name __attribute((unused)),
+ const char *name __attribute__((unused)),
struct daemon_parms *parms)
{
float percent = 0.0;
}
static int _is_partial_lv(struct logical_volume *lv,
- void *baton __attribute((unused)))
+ void *baton __attribute__((unused)))
{
return lv->status & PARTIAL_LV;
}
* Generic mirror parameter checks.
* FIXME: Should eventually be moved into lvm library.
*/
-static int _validate_mirror_params(const struct cmd_context *cmd __attribute((unused)),
+static int _validate_mirror_params(const struct cmd_context *cmd __attribute__((unused)),
const struct lvcreate_params *lp)
{
int pagesize = lvm_getpagesize();
return lvm2_main(argc, argv);
}
-int lvm_shell(struct cmd_context *cmd __attribute((unused)),
- struct cmdline_context *cmdline __attribute((unused)))
+int lvm_shell(struct cmd_context *cmd __attribute__((unused)),
+ struct cmdline_context *cmdline __attribute__((unused)))
{
return 0;
}
/* Custom completion function */
static char **_completion(const char *text, int start_pos,
- int end_pos __attribute((unused)))
+ int end_pos __attribute__((unused)))
{
char **match_list = NULL;
int p = 0;
return cmdlib_lvm2_init(0);
}
-int lvm_shell(struct cmd_context *cmd __attribute((unused)),
- struct cmdline_context *cmdline __attribute((unused)))
+int lvm_shell(struct cmd_context *cmd __attribute__((unused)),
+ struct cmdline_context *cmdline __attribute__((unused)))
{
return 0;
}
#include "tools.h"
-int lvmchange(struct cmd_context *cmd __attribute((unused)),
- int argc __attribute((unused)), char **argv __attribute((unused)))
+int lvmchange(struct cmd_context *cmd __attribute__((unused)),
+ int argc __attribute__((unused)), char **argv __attribute__((unused)))
{
log_error("With LVM2 and the device mapper, this program is obsolete.");
return ECMD_FAILED;
/* Command line args */
/* FIXME: Move static _the_args into cmd? */
-unsigned arg_count(const struct cmd_context *cmd __attribute((unused)), int a)
+unsigned arg_count(const struct cmd_context *cmd __attribute__((unused)), int a)
{
return _the_args[a].count;
}
return arg_count(cmd, a) ? 1 : 0;
}
-const char *arg_value(struct cmd_context *cmd __attribute((unused)), int a)
+const char *arg_value(struct cmd_context *cmd __attribute__((unused)), int a)
{
return _the_args[a].value;
}
return arg_count(cmd, a) ? _the_args[a].percent : def;
}
-int arg_count_increment(struct cmd_context *cmd __attribute((unused)), int a)
+int arg_count_increment(struct cmd_context *cmd __attribute__((unused)), int a)
{
return _the_args[a].count++;
}
-int yes_no_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int yes_no_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
a->sign = SIGN_NONE;
a->percent = PERCENT_NONE;
return 1;
}
-int yes_no_excl_arg(struct cmd_context *cmd __attribute((unused)),
+int yes_no_excl_arg(struct cmd_context *cmd __attribute__((unused)),
struct arg *a)
{
a->sign = SIGN_NONE;
}
/* Size stored in sectors */
-static int _size_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a, int factor)
+static int _size_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a, int factor)
{
char *ptr;
int i;
return _size_arg(cmd, a, 2048);
}
-int int_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int int_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
char *ptr;
return 1;
}
-int int_arg_with_sign(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int int_arg_with_sign(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
char *ptr;
return 1;
}
-int int_arg_with_sign_and_percent(struct cmd_context *cmd __attribute((unused)),
+int int_arg_with_sign_and_percent(struct cmd_context *cmd __attribute__((unused)),
struct arg *a)
{
char *ptr;
return 1;
}
-int minor_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int minor_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
char *ptr;
return 1;
}
-int major_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int major_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
char *ptr;
return 1;
}
-int string_arg(struct cmd_context *cmd __attribute((unused)),
- struct arg *a __attribute((unused)))
+int string_arg(struct cmd_context *cmd __attribute__((unused)),
+ struct arg *a __attribute__((unused)))
{
return 1;
}
-int tag_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int tag_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
char *pos = a->value;
return 1;
}
-int permission_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int permission_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
a->sign = SIGN_NONE;
return 1;
}
-int alloc_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int alloc_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
alloc_policy_t alloc;
/*
* Positive integer, zero or "auto".
*/
-int readahead_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
+int readahead_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a)
{
if (!strcasecmp(a->value, "auto")) {
a->ui_value = DM_READ_AHEAD_AUTO;
/*
* Non-zero, positive integer, "all", or "unmanaged"
*/
-int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)),
+int metadatacopies_arg(struct cmd_context *cmd __attribute__((unused)),
struct arg *a)
{
if (!strncmp(cmd->command->name, "vg", 2)) {
return 1;
}
-int version(struct cmd_context *cmd __attribute((unused)),
- int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int version(struct cmd_context *cmd __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
char vsn[80];
}
}
-int help(struct cmd_context *cmd __attribute((unused)), int argc, char **argv)
+int help(struct cmd_context *cmd __attribute__((unused)), int argc, char **argv)
{
int ret = ECMD_PROCESSED;
return 1;
}
-int lvmdiskscan(struct cmd_context *cmd, int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int lvmdiskscan(struct cmd_context *cmd, int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
uint64_t size;
struct dev_iter *iter;
#include "tools.h"
static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct logical_volume *origin;
#include "tools.h"
static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct lvinfo info;
int lv_total = 0;
#include <signal.h>
#include <sys/wait.h>
-static void _sigchld_handler(int sig __attribute((unused)))
+static void _sigchld_handler(int sig __attribute__((unused)))
{
while (wait4(-1, NULL, WNOHANG | WUNTRACED, NULL) > 0) ;
}
static int _pvchange_single(struct cmd_context *cmd, struct volume_group *vg,
struct physical_volume *pv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
uint32_t orig_pe_alloc_count;
/* FIXME Next three only required for format1. */
const char *pv_name = pv_dev_name(pv);
const char *tag = NULL;
const char *orig_vg_name;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
int allocatable = 0;
int tagarg = 0;
static struct volume_group *_get_move_vg(struct cmd_context *cmd,
const char *name,
- const char *uuid __attribute((unused)))
+ const char *uuid __attribute__((unused)))
{
struct physical_volume *pv;
}
static int pvremove_single(struct cmd_context *cmd, const char *pv_name,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct device *dev;
int ret = ECMD_FAILED;
static void _pvscan_display_single(struct cmd_context *cmd,
struct physical_volume *pv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
unsigned vg_name_len = 0;
char pv_tmp_name[NAME_LEN] = { 0, };
pv_pe_size(pv)));
}
-int pvscan(struct cmd_context *cmd, int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
int new_pvs_found = 0;
int pvs_found = 0;
#include "tools.h"
#include "report.h"
-static int _vgs_single(struct cmd_context *cmd __attribute((unused)),
+static int _vgs_single(struct cmd_context *cmd __attribute__((unused)),
const char *vg_name, struct volume_group *vg,
void *handle)
{
return ECMD_PROCESSED;
}
-static int _segs_single(struct cmd_context *cmd __attribute((unused)),
+static int _segs_single(struct cmd_context *cmd __attribute__((unused)),
struct lv_segment *seg, void *handle)
{
if (!report_object(handle, seg->lv->vg, seg->lv, NULL, seg, NULL)) {
int ret = ECMD_PROCESSED;
const char *vg_name = NULL;
struct volume_group *old_vg = vg;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (is_pv(pv) && !is_orphan(pv) && !vg) {
vg_name = pv_vg_name(pv);
#include "tools.h"
-int segtypes(struct cmd_context *cmd, int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int segtypes(struct cmd_context *cmd, int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
display_segtypes(cmd);
log_error("Command not implemented yet."); return ECMD_FAILED
/*int e2fsadm(struct cmd_context *cmd, int argc, char **argv) unimplemented*/
-int lvmsadc(struct cmd_context *cmd __attribute((unused)),
- int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int lvmsadc(struct cmd_context *cmd __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
unimplemented;
}
-int lvmsar(struct cmd_context *cmd __attribute((unused)),
- int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int lvmsar(struct cmd_context *cmd __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
unimplemented;
}
-int pvdata(struct cmd_context *cmd __attribute((unused)),
- int argc __attribute((unused)),
- char **argv __attribute((unused)))
+int pvdata(struct cmd_context *cmd __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char **argv __attribute__((unused)))
{
log_error("There's no 'pvdata' command in LVM2.");
log_error("Use lvs, pvs, vgs instead; or use vgcfgbackup and read the text file backup.");
int segtype_arg(struct cmd_context *cmd, struct arg *a);
int alloc_arg(struct cmd_context *cmd, struct arg *a);
int readahead_arg(struct cmd_context *cmd, struct arg *a);
-int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a);
+int metadatacopies_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a);
/* we use the enums to access the switches */
unsigned arg_count(const struct cmd_context *cmd, int a);
return ECMD_PROCESSED;
}
-static int _vgchange_uuid(struct cmd_context *cmd __attribute((unused)),
+static int _vgchange_uuid(struct cmd_context *cmd __attribute__((unused)),
struct volume_group *vg)
{
struct lv_list *lvl;
static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
int dmeventd_mode, r = ECMD_FAILED;
#include "tools.h"
#include "metadata.h"
-static int vgck_single(struct cmd_context *cmd __attribute((unused)),
+static int vgck_single(struct cmd_context *cmd __attribute__((unused)),
const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
if (!vg_check_status(vg, EXPORTED_VG)) {
stack;
static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct physical_volume *pv, *existing_pv;
struct logical_volume *lv;
static int vgdisplay_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
/* FIXME Do the active check here if activevolumegroups_ARG ? */
vg_check_status(vg, EXPORTED_VG);
#include "tools.h"
-static int vgexport_single(struct cmd_context *cmd __attribute((unused)),
+static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct pv_list *pvl;
struct physical_volume *pv;
#include "tools.h"
-static int vgimport_single(struct cmd_context *cmd __attribute((unused)),
+static int vgimport_single(struct cmd_context *cmd __attribute__((unused)),
const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct pv_list *pvl;
struct physical_volume *pv;
/* Fix up LVIDs */
dm_list_iterate_items(lvl1, &vg_to->lvs) {
union lvid *lvid1 = &lvl1->lv->lvid;
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
dm_list_iterate_items(lvl2, &vg_from->lvs) {
union lvid *lvid2 = &lvl2->lv->lvid;
#include "tools.h"
static int _vgmknodes_single(struct cmd_context *cmd, struct logical_volume *lv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
if (arg_count(cmd, refresh_ARG) && lv_is_visible(lv))
if (!lv_refresh(cmd, lv)) {
static int _remove_pv(struct volume_group *vg, struct pv_list *pvl, int silent)
{
- char uuid[64] __attribute((aligned(8)));
+ char uuid[64] __attribute__((aligned(8)));
if (vg->pv_count == 1) {
log_error("Volume Groups must always contain at least one PV");
/* Or take pv_name instead? */
static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
struct physical_volume *pv,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
struct pv_list *pvl;
struct volume_group *orphan_vg = NULL;
static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
unsigned lv_count, missing;
force_t force;
static int vgscan_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle __attribute((unused)))
+ void *handle __attribute__((unused)))
{
log_print("Found %svolume group \"%s\" using metadata type %s",
vg_is_exported(vg) ? "exported " : "", vg_name,