summaryrefslogtreecommitdiffstats
path: root/daemons/cmirrord
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2010-01-20 02:43:19 +0000
committerAlasdair Kergon <agk@redhat.com>2010-01-20 02:43:19 +0000
commite408cf690683195b1ff5402b6a8b6ed2a6d7d1d0 (patch)
tree83f962755f6169b0f26343722e16e1d0befe3249 /daemons/cmirrord
parent13ecd94aeff674a6a3342074e340ae4df38da94b (diff)
downloadlvm2-e408cf690683195b1ff5402b6a8b6ed2a6d7d1d0.tar.gz
lvm2-e408cf690683195b1ff5402b6a8b6ed2a6d7d1d0.tar.xz
lvm2-e408cf690683195b1ff5402b6a8b6ed2a6d7d1d0.zip
Deal with a few more compiler warnings.
Diffstat (limited to 'daemons/cmirrord')
-rw-r--r--daemons/cmirrord/cluster.c21
-rw-r--r--daemons/cmirrord/cluster.h2
-rw-r--r--daemons/cmirrord/functions.c2
3 files changed, 13 insertions, 12 deletions
diff --git a/daemons/cmirrord/cluster.c b/daemons/cmirrord/cluster.c
index 932abc48..a77a11f2 100644
--- a/daemons/cmirrord/cluster.c
+++ b/daemons/cmirrord/cluster.c
@@ -436,9 +436,9 @@ static int export_checkpoint(struct checkpoint_data *cp)
len = snprintf((char *)(name.value), SA_MAX_NAME_LENGTH,
"bitmaps_%s_%u", SHORT_UUID(cp->uuid), cp->requester);
- name.length = len;
+ name.length = (SaUint16T)len;
- len = strlen(cp->recovering_region) + 1;
+ len = (int)strlen(cp->recovering_region) + 1;
attr.creationFlags = SA_CKPT_WR_ALL_REPLICAS;
attr.checkpointSize = cp->bitmap_size * 2 + len;
@@ -476,7 +476,7 @@ open_retry:
/*
* Add section for sync_bits
*/
- section_id.idLen = snprintf(buf, 32, "sync_bits");
+ section_id.idLen = (SaUint16T)snprintf(buf, 32, "sync_bits");
section_id.id = (unsigned char *)buf;
section_attr.sectionId = &section_id;
section_attr.expirationTime = SA_TIME_END;
@@ -605,7 +605,7 @@ static int import_checkpoint(struct clog_cpg *entry, int no_read)
len = snprintf((char *)(name.value), SA_MAX_NAME_LENGTH, "bitmaps_%s_%u",
SHORT_UUID(entry->name.value), my_cluster_id);
- name.length = len;
+ name.length = (SaUint16T)len;
open_retry:
rv = saCkptCheckpointOpen(ckpt_handle, &name, NULL,
@@ -1157,8 +1157,8 @@ static void cpg_join_callback(struct clog_cpg *match,
const struct cpg_address *member_list,
size_t member_list_entries)
{
- int i;
- int my_pid = getpid();
+ unsigned i;
+ uint32_t my_pid = (uint32_t)getpid();
uint32_t lowest = match->lowest_id;
struct clog_request *rq;
char dbuf[32];
@@ -1178,7 +1178,7 @@ static void cpg_join_callback(struct clog_cpg *match,
goto out;
memset(dbuf, 0, sizeof(dbuf));
- for (i = 0; i < (member_list_entries-1); i++)
+ for (i = 0; i < member_list_entries - 1; i++)
sprintf(dbuf+strlen(dbuf), "%u-", member_list[i].nodeid);
sprintf(dbuf+strlen(dbuf), "(%u)", joined->nodeid);
LOG_COND(log_checkpoint, "[%s] Joining node, %u needs checkpoint [%s]",
@@ -1236,7 +1236,8 @@ static void cpg_leave_callback(struct clog_cpg *match,
const struct cpg_address *member_list,
size_t member_list_entries)
{
- int i, j, fd;
+ unsigned i;
+ int j, fd;
uint32_t lowest = match->lowest_id;
struct clog_request *rq, *n;
struct checkpoint_data *p_cp, *c_cp;
@@ -1456,7 +1457,7 @@ unlink_retry:
int create_cluster_cpg(char *uuid, uint64_t luid)
{
int r;
- int size;
+ size_t size;
struct clog_cpg *new = NULL;
struct clog_cpg *tmp;
@@ -1480,7 +1481,7 @@ int create_cluster_cpg(char *uuid, uint64_t luid)
size = ((strlen(uuid) + 1) > CPG_MAX_NAME_LENGTH) ?
CPG_MAX_NAME_LENGTH : (strlen(uuid) + 1);
strncpy(new->name.value, uuid, size);
- new->name.length = size;
+ new->name.length = (uint32_t)size;
new->luid = luid;
/*
diff --git a/daemons/cmirrord/cluster.h b/daemons/cmirrord/cluster.h
index 8489ddb9..50d87ddb 100644
--- a/daemons/cmirrord/cluster.h
+++ b/daemons/cmirrord/cluster.h
@@ -15,7 +15,7 @@
#include "dm-log-userspace.h"
#include "libdevmapper.h"
-#define DM_ULOG_RESPONSE 0x1000 /* in last byte of 32-bit value */
+#define DM_ULOG_RESPONSE 0x1000U /* in last byte of 32-bit value */
#define DM_ULOG_CHECKPOINT_READY 21
#define DM_ULOG_MEMBER_JOIN 22
diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
index aa49d14e..0b96f2ea 100644
--- a/daemons/cmirrord/functions.c
+++ b/daemons/cmirrord/functions.c
@@ -290,7 +290,7 @@ static int write_log(struct log_c *lc)
}
/* 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)
+static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_path __attribute((unused)))
{
int r;
DIR *dp;