  We use overlap fermions as valence quarks to calculate meson masses in a wide
quark mass range on the $2+1$-flavor domain-wall fermion gauge configurations
generated by the RBC and UKQCD Collaborations. The well-defined quark masses in
the overlap fermion formalism and the clear valence quark mass dependence of
meson masses observed from the calculation facilitate a direct derivation of
physical current quark masses through a global fit to the lattice data, which
incorporates $O(a^2)$ and $O(m_c^4a^4)$ corrections, chiral extrapolation, and
quark mass interpolation. Using the physical masses of $D_s$, $D_s^*$ and
$J/\psi$ as inputs, Sommer's scale parameter $r_0$ and the masses of charm
quark and strange quark in the $\overline{\rm MS}$ scheme are determined to be
$r_0=0.465(4)(9)$ fm, $m_c^{\overline{\rm MS}}(2\,{\rm GeV})=1.118(6)(24)$ GeV
(or $m_c^{\overline{\rm MS}}(m_c)=1.304(5)(20)$ GeV), and $m_s^{\overline{\rm
MS}}(2\,{\rm GeV})=0.101(3)(6)\,{\rm GeV}$, respectively. Furthermore, we
observe that the mass difference of the vector meson and the pseudoscalar meson
with the same valence quark content is proportional to the reciprocal of the
square root of the valence quark masses. The hyperfine splitting of charmonium,
$M_{J/\psi}-M_{\eta_c}$, is determined to be 119(2)(7) MeV, which is in good
agreement with the experimental value. We also predict the decay constant of
$D_s$ to be $f_{D_s}=254(2)(4)$ MeV. The masses of charmonium $P$-wave states
$\chi_{c0}, \chi_{c1}$ and $h_c$ are also in good agreement with experiments.
