Re: [PATCH] ceph: use ktime_to_timespec64() rather than jiffies_to_timespec64()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 1, 2022 at 10:32 PM Ilya Dryomov <idryomov@xxxxxxxxx> wrote:
>
> On Wed, Feb 9, 2022 at 7:55 PM Venky Shankar <vshankar@xxxxxxxxxx> wrote:
> >
> > Latencies are of type ktime_t, coverting from jiffies is incorrect.
> > Also, switch to "struct ceph_timespec" for r/w/m latencies.
> >
> > Signed-off-by: Venky Shankar <vshankar@xxxxxxxxxx>
> > ---
> >  fs/ceph/metric.c | 20 ++++++++++----------
> >  fs/ceph/metric.h | 11 ++++-------
> >  2 files changed, 14 insertions(+), 17 deletions(-)
> >
> > diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
> > index 0fcba68f9a99..a9cd23561a0d 100644
> > --- a/fs/ceph/metric.c
> > +++ b/fs/ceph/metric.c
> > @@ -8,6 +8,13 @@
> >  #include "metric.h"
> >  #include "mds_client.h"
> >
> > +static void to_ceph_timespec(struct ceph_timespec *ts, ktime_t val)
>
> Hi Venky,
>
> I think ktime_to_ceph_timespec() would be a much better name.
>
> > +{
> > +       struct timespec64 t = ktime_to_timespec64(val);
> > +       ts->tv_sec = cpu_to_le32(t.tv_sec);
> > +       ts->tv_nsec = cpu_to_le32(t.tv_nsec);
>
> ceph_encode_timespec64() does this with appropriate casts, let's use
> it.

Makes sense.

BTW, this fix would be a new change I guess? (rather than sending an
updated version of the patch since it has been merged in -testing)?

>
> Thanks,
>
>                 Ilya
>


-- 
Cheers,
Venky




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux