1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-31 14:50:37 +03:00

Fix some compiler warnings.

This commit is contained in:
Jonathan Earl Brassow 2010-01-18 20:58:50 +00:00
parent 09cf0fe6b9
commit a78e7d0287
3 changed files with 14 additions and 10 deletions

View File

@ -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 = (char *)data + COMPAT_OFFSET;
rq = data + COMPAT_OFFSET;
break;
default:
LOG_ERROR("Unable to process cluster message: "

View File

@ -933,13 +933,13 @@ static int clog_get_region_size(struct dm_ulog_request *rq)
static int clog_is_clean(struct dm_ulog_request *rq)
{
int64_t *rtn = (int64_t *)rq->data;
uint64_t region = *((uint64_t *)(rq->data));
uint64_t *region = (uint64_t *)rq->data;
struct log_c *lc = get_log(rq->uuid, rq->luid);
if (!lc)
return -EINVAL;
*rtn = log_test_bit(lc->clean_bits, region);
*rtn = log_test_bit(lc->clean_bits, *region);
rq->data_size = sizeof(*rtn);
return 0;
@ -958,7 +958,8 @@ static int clog_is_clean(struct dm_ulog_request *rq)
static int clog_in_sync(struct dm_ulog_request *rq)
{
int64_t *rtn = (int64_t *)rq->data;
uint64_t region = *((uint64_t *)(rq->data));
uint64_t *region_p = (uint64_t *)rq->data;
uint64_t region = *region_p;
struct log_c *lc = get_log(rq->uuid, rq->luid);
if (!lc)
@ -1487,7 +1488,8 @@ static int clog_status_table(struct dm_ulog_request *rq)
*/
static int clog_is_remote_recovering(struct dm_ulog_request *rq)
{
uint64_t region = *((uint64_t *)(rq->data));
uint64_t *region_p = (uint64_t *)rq->data;
uint64_t region = *region_p;
struct {
int64_t is_recovering;
uint64_t in_sync_hint;

View File

@ -89,8 +89,10 @@ static int kernel_recv(struct clog_request **rq)
{
int r = 0;
int len;
void *foo;
struct cn_msg *msg;
struct dm_ulog_request *u_rq;
struct nlmsghdr *nlmsg_h;
*rq = NULL;
memset(recv_buf, 0, sizeof(recv_buf));
@ -102,7 +104,8 @@ static int kernel_recv(struct clog_request **rq)
goto fail;
}
switch (((struct nlmsghdr *)recv_buf)->nlmsg_type) {
nlmsg_h = (struct nlmsghdr *)recv_buf;
switch (nlmsg_h->nlmsg_type) {
case NLMSG_ERROR:
LOG_ERROR("Unable to recv message from kernel: NLMSG_ERROR");
r = -EBADE;
@ -158,10 +161,9 @@ static int kernel_recv(struct clog_request **rq)
* beyond what is available to us, but we need only check it
* once... perhaps at compile time?
*/
// *rq = container_of(u_rq, struct clog_request, u_rq);
*rq = (char *)u_rq -
(sizeof(struct clog_request) -
sizeof(struct dm_ulog_request));
foo = u_rq;
foo -= (sizeof(struct clog_request) - sizeof(struct dm_ulog_request));
*rq = foo;
/* Clear the wrapper container fields */
memset(*rq, 0, (char *)u_rq - (char *)(*rq));