Commit 3c802092 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov

ceph: print r_direct_hash in hex in __choose_mds() dout

It's hard to read, especially when it is:

  ceph:  __choose_mds 00000000b7bc9c15 is_hash=1 (-271041095) mode 0

At the same time, switch to __func__ to get rid of the checkpatch
warning.
Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 78beb0ff
...@@ -900,7 +900,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -900,7 +900,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
if (req->r_resend_mds >= 0 && if (req->r_resend_mds >= 0 &&
(__have_session(mdsc, req->r_resend_mds) || (__have_session(mdsc, req->r_resend_mds) ||
ceph_mdsmap_get_state(mdsc->mdsmap, req->r_resend_mds) > 0)) { ceph_mdsmap_get_state(mdsc->mdsmap, req->r_resend_mds) > 0)) {
dout("choose_mds using resend_mds mds%d\n", dout("%s using resend_mds mds%d\n", __func__,
req->r_resend_mds); req->r_resend_mds);
return req->r_resend_mds; return req->r_resend_mds;
} }
...@@ -918,7 +918,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -918,7 +918,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
rcu_read_lock(); rcu_read_lock();
inode = get_nonsnap_parent(req->r_dentry); inode = get_nonsnap_parent(req->r_dentry);
rcu_read_unlock(); rcu_read_unlock();
dout("__choose_mds using snapdir's parent %p\n", inode); dout("%s using snapdir's parent %p\n", __func__, inode);
} }
} else if (req->r_dentry) { } else if (req->r_dentry) {
/* ignore race with rename; old or new d_parent is okay */ /* ignore race with rename; old or new d_parent is okay */
...@@ -938,7 +938,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -938,7 +938,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
/* direct snapped/virtual snapdir requests /* direct snapped/virtual snapdir requests
* based on parent dir inode */ * based on parent dir inode */
inode = get_nonsnap_parent(parent); inode = get_nonsnap_parent(parent);
dout("__choose_mds using nonsnap parent %p\n", inode); dout("%s using nonsnap parent %p\n", __func__, inode);
} else { } else {
/* dentry target */ /* dentry target */
inode = d_inode(req->r_dentry); inode = d_inode(req->r_dentry);
...@@ -954,8 +954,8 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -954,8 +954,8 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
rcu_read_unlock(); rcu_read_unlock();
} }
dout("__choose_mds %p is_hash=%d (%d) mode %d\n", inode, (int)is_hash, dout("%s %p is_hash=%d (0x%x) mode %d\n", __func__, inode, (int)is_hash,
(int)hash, mode); hash, mode);
if (!inode) if (!inode)
goto random; goto random;
ci = ceph_inode(inode); ci = ceph_inode(inode);
...@@ -973,11 +973,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -973,11 +973,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
get_random_bytes(&r, 1); get_random_bytes(&r, 1);
r %= frag.ndist; r %= frag.ndist;
mds = frag.dist[r]; mds = frag.dist[r];
dout("choose_mds %p %llx.%llx " dout("%s %p %llx.%llx frag %u mds%d (%d/%d)\n",
"frag %u mds%d (%d/%d)\n", __func__, inode, ceph_vinop(inode),
inode, ceph_vinop(inode), frag.frag, mds, (int)r, frag.ndist);
frag.frag, mds,
(int)r, frag.ndist);
if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >= if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
CEPH_MDS_STATE_ACTIVE && CEPH_MDS_STATE_ACTIVE &&
!ceph_mdsmap_is_laggy(mdsc->mdsmap, mds)) !ceph_mdsmap_is_laggy(mdsc->mdsmap, mds))
...@@ -990,9 +988,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -990,9 +988,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
if (frag.mds >= 0) { if (frag.mds >= 0) {
/* choose auth mds */ /* choose auth mds */
mds = frag.mds; mds = frag.mds;
dout("choose_mds %p %llx.%llx " dout("%s %p %llx.%llx frag %u mds%d (auth)\n",
"frag %u mds%d (auth)\n", __func__, inode, ceph_vinop(inode),
inode, ceph_vinop(inode), frag.frag, mds); frag.frag, mds);
if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >= if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
CEPH_MDS_STATE_ACTIVE) { CEPH_MDS_STATE_ACTIVE) {
if (mode == USE_ANY_MDS && if (mode == USE_ANY_MDS &&
...@@ -1017,7 +1015,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -1017,7 +1015,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
goto random; goto random;
} }
mds = cap->session->s_mds; mds = cap->session->s_mds;
dout("choose_mds %p %llx.%llx mds%d (%scap %p)\n", dout("%s %p %llx.%llx mds%d (%scap %p)\n", __func__,
inode, ceph_vinop(inode), mds, inode, ceph_vinop(inode), mds,
cap == ci->i_auth_cap ? "auth " : "", cap); cap == ci->i_auth_cap ? "auth " : "", cap);
spin_unlock(&ci->i_ceph_lock); spin_unlock(&ci->i_ceph_lock);
...@@ -1032,7 +1030,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -1032,7 +1030,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
*random = true; *random = true;
mds = ceph_mdsmap_get_random_mds(mdsc->mdsmap); mds = ceph_mdsmap_get_random_mds(mdsc->mdsmap);
dout("choose_mds chose random mds%d\n", mds); dout("%s chose random mds%d\n", __func__, mds);
return mds; return mds;
} }
......
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