1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

Misc compilation clean-ups.

This commit is contained in:
Alasdair Kergon 2010-01-18 20:08:44 +00:00
parent 13713bc147
commit 09cf0fe6b9
8 changed files with 31 additions and 30 deletions

View File

@ -46,7 +46,7 @@ static void daemonize(void);
static void init_all(void);
static void cleanup_all(void);
int main(int argc, char *argv[])
int main(int argc __attribute((unused)), char *argv[] __attribute((unused)))
{
daemonize();
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
* @sig: the signal
*
*/
static void parent_exit_handler(int sig)
static void parent_exit_handler(int sig __attribute((unused)))
{
exit_now = 1;
}
@ -85,7 +85,7 @@ static void parent_exit_handler(int sig)
*
* Returns: 0 on success, -1 otherwise
*/
static int create_lockfile(char *lockfile)
static int create_lockfile(const char *lockfile)
{
int fd;
struct flock lock;

View File

@ -227,7 +227,7 @@ static struct clog_request *get_matching_rq(struct clog_request *rq,
}
static char rq_buffer[DM_ULOG_REQUEST_SIZE];
static int handle_cluster_request(struct clog_cpg *entry,
static int handle_cluster_request(struct clog_cpg *entry __attribute((unused)),
struct clog_request *rq, int server)
{
int r = 0;
@ -867,7 +867,7 @@ static int resend_requests(struct clog_cpg *entry)
return r;
}
static int do_cluster_work(void *data)
static int do_cluster_work(void *data __attribute((unused)))
{
int r = SA_AIS_OK;
struct clog_cpg *entry;
@ -939,8 +939,8 @@ static int flush_startup_list(struct clog_cpg *entry)
return 0;
}
static void cpg_message_callback(cpg_handle_t handle, const struct cpg_name *gname,
uint32_t nodeid, uint32_t pid,
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;
@ -1377,7 +1377,7 @@ static void cpg_leave_callback(struct clog_cpg *match,
}
}
static void cpg_config_callback(cpg_handle_t handle, const struct cpg_name *gname,
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,
@ -1422,7 +1422,7 @@ cpg_callbacks_t cpg_callbacks = {
*
* Returns: 1 if checkpoint removed, 0 if no checkpoints, -EXXX on error
*/
int remove_checkpoint(struct clog_cpg *entry)
static int remove_checkpoint(struct clog_cpg *entry)
{
int len;
SaNameT name;

View File

@ -25,7 +25,7 @@
*/
#define COMPAT_OFFSET 256
static void v5_data_endian_switch(struct clog_request *rq, int to_network)
static void v5_data_endian_switch(struct clog_request *rq, int to_network __attribute((unused)))
{
int i, end;
int64_t *pi64;
@ -201,7 +201,7 @@ int clog_request_from_network(void *data, size_t data_len)
if (data_len < (COMPAT_OFFSET + sizeof(*rq)))
return -ENOSPC;
rq = data + COMPAT_OFFSET;
rq = (char *)data + COMPAT_OFFSET;
break;
default:
LOG_ERROR("Unable to process cluster message: "

View File

@ -262,7 +262,7 @@ static int read_log(struct log_c *lc)
bitset_size += (lc->region_count % 8) ? 1 : 0;
/* 'lc->clean_bits + 1' becasue dm_bitset_t leads with a uint32_t */
memcpy(lc->clean_bits + 1, lc->disk_buffer + 1024, bitset_size);
memcpy(lc->clean_bits + 1, (char *)lc->disk_buffer + 1024, bitset_size);
return 0;
}
@ -289,7 +289,7 @@ static int write_log(struct log_c *lc)
bitset_size += (lc->region_count % 8) ? 1 : 0;
/* 'lc->clean_bits + 1' becasue dm_bitset_t leads with a uint32_t */
memcpy(lc->disk_buffer + 1024, lc->clean_bits + 1, bitset_size);
memcpy((char *)lc->disk_buffer + 1024, lc->clean_bits + 1, bitset_size);
if (rw_log(lc, 1)) {
lc->log_dev_failed = 1;
@ -372,7 +372,7 @@ static int _clog_ctr(char *uuid, uint64_t luid,
uint64_t region_count;
struct log_c *lc = NULL;
struct log_c *duplicate;
enum sync sync = DEFAULTSYNC;
enum sync log_sync = DEFAULTSYNC;
uint32_t block_on_error = 0;
int disk_log = 0;
@ -427,9 +427,9 @@ static int _clog_ctr(char *uuid, uint64_t luid,
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "sync"))
sync = FORCESYNC;
log_sync = FORCESYNC;
else if (!strcmp(argv[i], "nosync"))
sync = NOSYNC;
log_sync = NOSYNC;
else if (!strcmp(argv[i], "block_on_error"))
block_on_error = 1;
}
@ -444,7 +444,7 @@ static int _clog_ctr(char *uuid, uint64_t luid,
lc->region_size = region_size;
lc->region_count = region_count;
lc->sync = sync;
lc->sync = log_sync;
lc->block_on_error = block_on_error;
lc->sync_search = 0;
lc->recovering_region = (uint64_t)-1;
@ -456,7 +456,7 @@ static int _clog_ctr(char *uuid, uint64_t luid,
if ((duplicate = get_log(lc->uuid, lc->luid)) ||
(duplicate = get_pending_log(lc->uuid, lc->luid))) {
LOG_ERROR("[%s/%llu] Log already exists, unable to create.",
LOG_ERROR("[%s/%" PRIu64 "u] Log already exists, unable to create.",
SHORT_UUID(lc->uuid), lc->luid);
free(lc);
return -EINVAL;
@ -477,10 +477,10 @@ static int _clog_ctr(char *uuid, uint64_t luid,
r = -ENOMEM;
goto fail;
}
if (sync == NOSYNC)
if (log_sync == NOSYNC)
dm_bit_set_all(lc->sync_bits);
lc->sync_count = (sync == NOSYNC) ? region_count : 0;
lc->sync_count = (log_sync == NOSYNC) ? region_count : 0;
if (disk_log) {
page_size = sysconf(_SC_PAGESIZE);
@ -1375,7 +1375,7 @@ static int clog_get_sync_count(struct dm_ulog_request *rq, uint32_t originator)
return 0;
}
static int core_status_info(struct log_c *lc, struct dm_ulog_request *rq)
static int core_status_info(struct log_c *lc __attribute((unused)), struct dm_ulog_request *rq)
{
char *data = (char *)rq->data;
@ -1648,7 +1648,7 @@ static void print_bits(dm_bitset_t bs, int print)
{
int i, size;
char outbuf[128];
unsigned char *buf = bs + 1;
unsigned char *buf = (unsigned char *)(bs + 1);
size = (*bs % 8) ? 1 : 0;
size += (*bs / 8);

View File

@ -14,10 +14,11 @@
#include <poll.h>
#include "logging.h"
#include "link_mon.h"
struct link_callback {
int fd;
char *name;
const char *name;
void *data;
int (*callback)(void *data);
@ -29,7 +30,7 @@ static int free_pfds = 0;
static struct pollfd *pfds = NULL;
static struct link_callback *callbacks = NULL;
int links_register(int fd, char *name, int (*callback)(void *data), void *data)
int links_register(int fd, const char *name, int (*callback)(void *data), void *data)
{
int i;
struct link_callback *lc;

View File

@ -12,7 +12,7 @@
#ifndef __LINK_MON_DOT_H__
#define __LINK_MON_DOT_H__
int links_register(int fd, char *name, int (*callback)(void *data), void *data);
int links_register(int fd, const char *name, int (*callback)(void *data), void *data);
int links_unregister(int fd);
int links_monitor(void);
int links_issue_callbacks(void);

View File

@ -28,7 +28,7 @@
#include "local.h"
#ifndef CN_IDX_DM
#warning Kernel should be at least 2.6.31
/* Kernel 2.6.31 is required to run this code */
#define CN_IDX_DM 0x7 /* Device Mapper */
#define CN_VAL_DM_USERSPACE_LOG 0x1
#endif
@ -159,12 +159,12 @@ static int kernel_recv(struct clog_request **rq)
* once... perhaps at compile time?
*/
// *rq = container_of(u_rq, struct clog_request, u_rq);
*rq = (void *)u_rq -
*rq = (char *)u_rq -
(sizeof(struct clog_request) -
sizeof(struct dm_ulog_request));
/* Clear the wrapper container fields */
memset(*rq, 0, (void *)u_rq - (void *)(*rq));
memset(*rq, 0, (char *)u_rq - (char *)(*rq));
break;
default:
LOG_ERROR("Unknown nlmsg_type");
@ -218,7 +218,7 @@ static int kernel_send_helper(void *data, int out_size)
*
* Returns: 0 on success, -EXXX on failure
*/
static int do_local_work(void *data)
static int do_local_work(void *data __attribute((unused)))
{
int r;
struct clog_request *rq;

View File

@ -12,7 +12,7 @@
#include <stdio.h>
#include <syslog.h>
char *__rq_types_off_by_one[] = {
const char *__rq_types_off_by_one[] = {
"DM_ULOG_CTR",
"DM_ULOG_DTR",
"DM_ULOG_PRESUSPEND",