Commit b9a67899 authored by Joe Perches's avatar Joe Perches Committed by Ilya Dryomov

libceph: Convert pr_warning to pr_warn

Use the more common pr_warn.

Other miscellanea:

o Coalesce formats
o Realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
parent 5d23371f
...@@ -293,17 +293,20 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name) { ...@@ -293,17 +293,20 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name) {
key_err = PTR_ERR(ukey); key_err = PTR_ERR(ukey);
switch (key_err) { switch (key_err) {
case -ENOKEY: case -ENOKEY:
pr_warning("ceph: Mount failed due to key not found: %s\n", name); pr_warn("ceph: Mount failed due to key not found: %s\n",
name);
break; break;
case -EKEYEXPIRED: case -EKEYEXPIRED:
pr_warning("ceph: Mount failed due to expired key: %s\n", name); pr_warn("ceph: Mount failed due to expired key: %s\n",
name);
break; break;
case -EKEYREVOKED: case -EKEYREVOKED:
pr_warning("ceph: Mount failed due to revoked key: %s\n", name); pr_warn("ceph: Mount failed due to revoked key: %s\n",
name);
break; break;
default: default:
pr_warning("ceph: Mount failed due to unknown key error" pr_warn("ceph: Mount failed due to unknown key error %d: %s\n",
" %d: %s\n", key_err, name); key_err, name);
} }
err = -EPERM; err = -EPERM;
goto out; goto out;
...@@ -433,7 +436,7 @@ ceph_parse_options(char *options, const char *dev_name, ...@@ -433,7 +436,7 @@ ceph_parse_options(char *options, const char *dev_name,
/* misc */ /* misc */
case Opt_osdtimeout: case Opt_osdtimeout:
pr_warning("ignoring deprecated osdtimeout option\n"); pr_warn("ignoring deprecated osdtimeout option\n");
break; break;
case Opt_osdkeepalivetimeout: case Opt_osdkeepalivetimeout:
opt->osd_keepalive_timeout = intval; opt->osd_keepalive_timeout = intval;
......
...@@ -1937,11 +1937,11 @@ static int process_banner(struct ceph_connection *con) ...@@ -1937,11 +1937,11 @@ static int process_banner(struct ceph_connection *con)
sizeof(con->peer_addr)) != 0 && sizeof(con->peer_addr)) != 0 &&
!(addr_is_blank(&con->actual_peer_addr.in_addr) && !(addr_is_blank(&con->actual_peer_addr.in_addr) &&
con->actual_peer_addr.nonce == con->peer_addr.nonce)) { con->actual_peer_addr.nonce == con->peer_addr.nonce)) {
pr_warning("wrong peer, want %s/%d, got %s/%d\n", pr_warn("wrong peer, want %s/%d, got %s/%d\n",
ceph_pr_addr(&con->peer_addr.in_addr), ceph_pr_addr(&con->peer_addr.in_addr),
(int)le32_to_cpu(con->peer_addr.nonce), (int)le32_to_cpu(con->peer_addr.nonce),
ceph_pr_addr(&con->actual_peer_addr.in_addr), ceph_pr_addr(&con->actual_peer_addr.in_addr),
(int)le32_to_cpu(con->actual_peer_addr.nonce)); (int)le32_to_cpu(con->actual_peer_addr.nonce));
con->error_msg = "wrong peer at address"; con->error_msg = "wrong peer at address";
return -1; return -1;
} }
...@@ -2302,7 +2302,7 @@ static int read_partial_message(struct ceph_connection *con) ...@@ -2302,7 +2302,7 @@ static int read_partial_message(struct ceph_connection *con)
BUG_ON(!con->in_msg ^ skip); BUG_ON(!con->in_msg ^ skip);
if (con->in_msg && data_len > con->in_msg->data_length) { if (con->in_msg && data_len > con->in_msg->data_length) {
pr_warning("%s skipping long message (%u > %zd)\n", pr_warn("%s skipping long message (%u > %zd)\n",
__func__, data_len, con->in_msg->data_length); __func__, data_len, con->in_msg->data_length);
ceph_msg_put(con->in_msg); ceph_msg_put(con->in_msg);
con->in_msg = NULL; con->in_msg = NULL;
...@@ -2712,7 +2712,7 @@ static bool con_sock_closed(struct ceph_connection *con) ...@@ -2712,7 +2712,7 @@ static bool con_sock_closed(struct ceph_connection *con)
CASE(OPEN); CASE(OPEN);
CASE(STANDBY); CASE(STANDBY);
default: default:
pr_warning("%s con %p unrecognized state %lu\n", pr_warn("%s con %p unrecognized state %lu\n",
__func__, con, con->state); __func__, con, con->state);
con->error_msg = "unrecognized con state"; con->error_msg = "unrecognized con state";
BUG(); BUG();
...@@ -2828,8 +2828,8 @@ static void con_work(struct work_struct *work) ...@@ -2828,8 +2828,8 @@ static void con_work(struct work_struct *work)
*/ */
static void con_fault(struct ceph_connection *con) static void con_fault(struct ceph_connection *con)
{ {
pr_warning("%s%lld %s %s\n", ENTITY_NAME(con->peer_name), pr_warn("%s%lld %s %s\n", ENTITY_NAME(con->peer_name),
ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg); ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg);
dout("fault %p state %lu to peer %s\n", dout("fault %p state %lu to peer %s\n",
con, con->state, ceph_pr_addr(&con->peer_addr.in_addr)); con, con->state, ceph_pr_addr(&con->peer_addr.in_addr));
......
...@@ -1182,10 +1182,10 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con, ...@@ -1182,10 +1182,10 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
pr_info("alloc_msg unknown type %d\n", type); pr_info("alloc_msg unknown type %d\n", type);
*skip = 1; *skip = 1;
} else if (front_len > m->front_alloc_len) { } else if (front_len > m->front_alloc_len) {
pr_warning("mon_alloc_msg front %d > prealloc %d (%u#%llu)\n", pr_warn("mon_alloc_msg front %d > prealloc %d (%u#%llu)\n",
front_len, m->front_alloc_len, front_len, m->front_alloc_len,
(unsigned int)con->peer_name.type, (unsigned int)con->peer_name.type,
le64_to_cpu(con->peer_name.num)); le64_to_cpu(con->peer_name.num));
ceph_msg_put(m); ceph_msg_put(m);
m = ceph_msg_new(type, front_len, GFP_NOFS, false); m = ceph_msg_new(type, front_len, GFP_NOFS, false);
} }
......
...@@ -1819,8 +1819,8 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, ...@@ -1819,8 +1819,8 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
} }
bytes = le32_to_cpu(msg->hdr.data_len); bytes = le32_to_cpu(msg->hdr.data_len);
if (payload_len != bytes) { if (payload_len != bytes) {
pr_warning("sum of op payload lens %d != data_len %d", pr_warn("sum of op payload lens %d != data_len %d\n",
payload_len, bytes); payload_len, bytes);
goto bad_put; goto bad_put;
} }
...@@ -2842,10 +2842,10 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, ...@@ -2842,10 +2842,10 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
ceph_msg_revoke_incoming(req->r_reply); ceph_msg_revoke_incoming(req->r_reply);
if (front_len > req->r_reply->front_alloc_len) { if (front_len > req->r_reply->front_alloc_len) {
pr_warning("get_reply front %d > preallocated %d (%u#%llu)\n", pr_warn("get_reply front %d > preallocated %d (%u#%llu)\n",
front_len, req->r_reply->front_alloc_len, front_len, req->r_reply->front_alloc_len,
(unsigned int)con->peer_name.type, (unsigned int)con->peer_name.type,
le64_to_cpu(con->peer_name.num)); le64_to_cpu(con->peer_name.num));
m = ceph_msg_new(CEPH_MSG_OSD_OPREPLY, front_len, GFP_NOFS, m = ceph_msg_new(CEPH_MSG_OSD_OPREPLY, front_len, GFP_NOFS,
false); false);
if (!m) if (!m)
...@@ -2868,8 +2868,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, ...@@ -2868,8 +2868,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
if (osd_data->pages && if (osd_data->pages &&
unlikely(osd_data->length < data_len)) { unlikely(osd_data->length < data_len)) {
pr_warning("tid %lld reply has %d bytes " pr_warn("tid %lld reply has %d bytes we had only %llu bytes ready\n",
"we had only %llu bytes ready\n",
tid, data_len, osd_data->length); tid, data_len, osd_data->length);
*skip = 1; *skip = 1;
ceph_msg_put(m); ceph_msg_put(m);
......
...@@ -521,11 +521,11 @@ static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi) ...@@ -521,11 +521,11 @@ static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi)
ev = ceph_decode_8(p); /* encoding version */ ev = ceph_decode_8(p); /* encoding version */
cv = ceph_decode_8(p); /* compat version */ cv = ceph_decode_8(p); /* compat version */
if (ev < 5) { if (ev < 5) {
pr_warning("got v %d < 5 cv %d of ceph_pg_pool\n", ev, cv); pr_warn("got v %d < 5 cv %d of ceph_pg_pool\n", ev, cv);
return -EINVAL; return -EINVAL;
} }
if (cv > 9) { if (cv > 9) {
pr_warning("got v %d cv %d > 9 of ceph_pg_pool\n", ev, cv); pr_warn("got v %d cv %d > 9 of ceph_pg_pool\n", ev, cv);
return -EINVAL; return -EINVAL;
} }
len = ceph_decode_32(p); len = ceph_decode_32(p);
...@@ -729,9 +729,9 @@ static int get_osdmap_client_data_v(void **p, void *end, ...@@ -729,9 +729,9 @@ static int get_osdmap_client_data_v(void **p, void *end,
ceph_decode_8_safe(p, end, struct_compat, e_inval); ceph_decode_8_safe(p, end, struct_compat, e_inval);
if (struct_compat > OSDMAP_WRAPPER_COMPAT_VER) { if (struct_compat > OSDMAP_WRAPPER_COMPAT_VER) {
pr_warning("got v %d cv %d > %d of %s ceph_osdmap\n", pr_warn("got v %d cv %d > %d of %s ceph_osdmap\n",
struct_v, struct_compat, struct_v, struct_compat,
OSDMAP_WRAPPER_COMPAT_VER, prefix); OSDMAP_WRAPPER_COMPAT_VER, prefix);
return -EINVAL; return -EINVAL;
} }
*p += 4; /* ignore wrapper struct_len */ *p += 4; /* ignore wrapper struct_len */
...@@ -739,9 +739,9 @@ static int get_osdmap_client_data_v(void **p, void *end, ...@@ -739,9 +739,9 @@ static int get_osdmap_client_data_v(void **p, void *end,
ceph_decode_8_safe(p, end, struct_v, e_inval); ceph_decode_8_safe(p, end, struct_v, e_inval);
ceph_decode_8_safe(p, end, struct_compat, e_inval); ceph_decode_8_safe(p, end, struct_compat, e_inval);
if (struct_compat > OSDMAP_CLIENT_DATA_COMPAT_VER) { if (struct_compat > OSDMAP_CLIENT_DATA_COMPAT_VER) {
pr_warning("got v %d cv %d > %d of %s ceph_osdmap client data\n", pr_warn("got v %d cv %d > %d of %s ceph_osdmap client data\n",
struct_v, struct_compat, struct_v, struct_compat,
OSDMAP_CLIENT_DATA_COMPAT_VER, prefix); OSDMAP_CLIENT_DATA_COMPAT_VER, prefix);
return -EINVAL; return -EINVAL;
} }
*p += 4; /* ignore client data struct_len */ *p += 4; /* ignore client data struct_len */
...@@ -751,8 +751,8 @@ static int get_osdmap_client_data_v(void **p, void *end, ...@@ -751,8 +751,8 @@ static int get_osdmap_client_data_v(void **p, void *end,
*p -= 1; *p -= 1;
ceph_decode_16_safe(p, end, version, e_inval); ceph_decode_16_safe(p, end, version, e_inval);
if (version < 6) { if (version < 6) {
pr_warning("got v %d < 6 of %s ceph_osdmap\n", version, pr_warn("got v %d < 6 of %s ceph_osdmap\n",
prefix); version, prefix);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment