Skip to content

Commit 3c80209

Browse files
lxbszidryomov
authored andcommitted
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: Xiubo Li <[email protected]> Reviewed-by: "Yan, Zheng" <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 78beb0f commit 3c80209

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

fs/ceph/mds_client.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
900900
if (req->r_resend_mds >= 0 &&
901901
(__have_session(mdsc, req->r_resend_mds) ||
902902
ceph_mdsmap_get_state(mdsc->mdsmap, req->r_resend_mds) > 0)) {
903-
dout("choose_mds using resend_mds mds%d\n",
903+
dout("%s using resend_mds mds%d\n", __func__,
904904
req->r_resend_mds);
905905
return req->r_resend_mds;
906906
}
@@ -918,7 +918,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
918918
rcu_read_lock();
919919
inode = get_nonsnap_parent(req->r_dentry);
920920
rcu_read_unlock();
921-
dout("__choose_mds using snapdir's parent %p\n", inode);
921+
dout("%s using snapdir's parent %p\n", __func__, inode);
922922
}
923923
} else if (req->r_dentry) {
924924
/* ignore race with rename; old or new d_parent is okay */
@@ -938,7 +938,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
938938
/* direct snapped/virtual snapdir requests
939939
* based on parent dir inode */
940940
inode = get_nonsnap_parent(parent);
941-
dout("__choose_mds using nonsnap parent %p\n", inode);
941+
dout("%s using nonsnap parent %p\n", __func__, inode);
942942
} else {
943943
/* dentry target */
944944
inode = d_inode(req->r_dentry);
@@ -954,8 +954,8 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
954954
rcu_read_unlock();
955955
}
956956

957-
dout("__choose_mds %p is_hash=%d (%d) mode %d\n", inode, (int)is_hash,
958-
(int)hash, mode);
957+
dout("%s %p is_hash=%d (0x%x) mode %d\n", __func__, inode, (int)is_hash,
958+
hash, mode);
959959
if (!inode)
960960
goto random;
961961
ci = ceph_inode(inode);
@@ -973,11 +973,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
973973
get_random_bytes(&r, 1);
974974
r %= frag.ndist;
975975
mds = frag.dist[r];
976-
dout("choose_mds %p %llx.%llx "
977-
"frag %u mds%d (%d/%d)\n",
978-
inode, ceph_vinop(inode),
979-
frag.frag, mds,
980-
(int)r, frag.ndist);
976+
dout("%s %p %llx.%llx frag %u mds%d (%d/%d)\n",
977+
__func__, inode, ceph_vinop(inode),
978+
frag.frag, mds, (int)r, frag.ndist);
981979
if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
982980
CEPH_MDS_STATE_ACTIVE &&
983981
!ceph_mdsmap_is_laggy(mdsc->mdsmap, mds))
@@ -990,9 +988,9 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
990988
if (frag.mds >= 0) {
991989
/* choose auth mds */
992990
mds = frag.mds;
993-
dout("choose_mds %p %llx.%llx "
994-
"frag %u mds%d (auth)\n",
995-
inode, ceph_vinop(inode), frag.frag, mds);
991+
dout("%s %p %llx.%llx frag %u mds%d (auth)\n",
992+
__func__, inode, ceph_vinop(inode),
993+
frag.frag, mds);
996994
if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
997995
CEPH_MDS_STATE_ACTIVE) {
998996
if (mode == USE_ANY_MDS &&
@@ -1017,7 +1015,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
10171015
goto random;
10181016
}
10191017
mds = cap->session->s_mds;
1020-
dout("choose_mds %p %llx.%llx mds%d (%scap %p)\n",
1018+
dout("%s %p %llx.%llx mds%d (%scap %p)\n", __func__,
10211019
inode, ceph_vinop(inode), mds,
10221020
cap == ci->i_auth_cap ? "auth " : "", cap);
10231021
spin_unlock(&ci->i_ceph_lock);
@@ -1032,7 +1030,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
10321030
*random = true;
10331031

10341032
mds = ceph_mdsmap_get_random_mds(mdsc->mdsmap);
1035-
dout("choose_mds chose random mds%d\n", mds);
1033+
dout("%s chose random mds%d\n", __func__, mds);
10361034
return mds;
10371035
}
10381036

0 commit comments

Comments
 (0)