Commit 33bbfa9c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

unix: Unify id and ino prints

Most of them already in hex form, lets do the same for the rest.
Also incoming connections are identified by inode number
so use hex for them as well for consistency.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d611ee03
......@@ -122,7 +122,7 @@ static void show_one_unix(char *act, const struct unix_sk_desc *sk)
int i;
for (i = 0; i < sk->nr_icons; i++)
pr_debug("\t\ticon: %4d\n", sk->icons[i]);
pr_debug("\t\ticon: %#x\n", sk->icons[i]);
}
}
......@@ -142,7 +142,7 @@ static int can_dump_unix_sk(const struct unix_sk_desc *sk)
if (sk->type != SOCK_STREAM &&
sk->type != SOCK_DGRAM &&
sk->type != SOCK_SEQPACKET) {
pr_err("Unsupported type (%d) on socket %x.\n"
pr_err("Unsupported type (%d) on socket %#x.\n"
"Only stream/dgram/seqpacket are supported.\n",
sk->type, sk->sd.ino);
return 0;
......@@ -154,7 +154,7 @@ static int can_dump_unix_sk(const struct unix_sk_desc *sk)
case TCP_CLOSE:
break;
default:
pr_err("Unknown state %d for unix socket %x\n",
pr_err("Unknown state %d for unix socket %#x\n",
sk->state, sk->sd.ino);
return 0;
}
......@@ -270,7 +270,7 @@ static int resolve_rel_name(uint32_t id, struct unix_sk_desc *sk, const struct f
return -ENOENT;
}
pr_debug("Resolving relative name %s for socket %x\n",
pr_debug("Resolving relative name %s for socket %#x\n",
sk->name, sk->sd.ino);
for (i = 0; i < ARRAY_SIZE(dirs); i++) {
......@@ -459,7 +459,7 @@ static int dump_one_unix_fd(int lfd, uint32_t id, const struct fd_parms *p)
* to check both ends on read()/write(). Thus mismatched sockets behave
* the same way as matched.
*/
pr_warn("Shutdown mismatch %u:%d -> %u:%d\n",
pr_warn("Shutdown mismatch %#x:%d -> %#x:%d\n",
ue->ino, ue->shutdown, peer->sd.ino, peer->shutdown);
}
} else if (ue->state == TCP_ESTABLISHED) {
......@@ -494,7 +494,7 @@ static int dump_one_unix_fd(int lfd, uint32_t id, const struct fd_parms *p)
/* e->sk_desc is _never_ NULL */
if (e->sk_desc->state != TCP_LISTEN) {
pr_err("In-flight connection on "
"non-listening socket %d\n", ue->ino);
"non-listening socket %#x\n", ue->ino);
goto err;
}
......@@ -731,7 +731,7 @@ static int unix_collect_one(const struct unix_diag_msg *m,
e->next = *chain;
*chain = e;
pr_debug("\t\tCollected icon %d\n", d->icons[i]);
pr_debug("\t\tCollected icon %#x\n", d->icons[i]);
e->peer_ino = n;
e->sk_desc = d;
......@@ -1005,11 +1005,11 @@ int unix_note_scm_rights(int id_for, uint32_t *file_ids, int *fds, int n_ids)
ui = find_queuer_for(id_for);
if (!ui) {
pr_err("Can't find sender for %d\n", id_for);
pr_err("Can't find sender for %#x\n", id_for);
return -1;
}
pr_info("Found queuer for %d -> %d\n", id_for, ui->ue->id);
pr_info("Found queuer for %#x -> %#x\n", id_for, ui->ue->id);
/*
* This is the task that will restore this socket
*/
......@@ -1030,7 +1030,7 @@ int unix_note_scm_rights(int id_for, uint32_t *file_ids, int *fds, int n_ids)
return -1;
}
pr_info("scm: add file %d -> %d\n", tgt->id, vpid(owner));
pr_info("scm: add file %#x -> %d\n", tgt->id, vpid(owner));
sfle = xmalloc(sizeof(*sfle));
if (!sfle)
return -1;
......@@ -1587,13 +1587,13 @@ static int open_unixsk_standalone(struct unix_sk_info *ui, int *new_fd)
int ret, sks[2];
if (ui->ue->type != SOCK_STREAM) {
pr_err("Non-stream socket %x in established state\n",
pr_err("Non-stream socket %#x in established state\n",
ui->ue->ino);
return -1;
}
if (ui->ue->shutdown != SK_SHUTDOWN__BOTH) {
pr_err("Wrong shutdown/peer state for %x\n",
pr_err("Wrong shutdown/peer state for %#x\n",
ui->ue->ino);
return -1;
}
......
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