From: Allen Pais <allen.lkml@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
ceph-devel@vger.kernel.org, y2038@lists.linaro.org,
Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH] ceph: use ktime_get_real_seconds()
Date: Wed, 20 Jun 2018 15:30:01 +0530 [thread overview]
Message-ID: <1529488801-22093-1-git-send-email-allen.lkml@gmail.com> (raw)
Use ktime_get_real_seconds() as get_seconds() is deprecated.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
net/ceph/auth_x.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 2f4a1ba..99561c2 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
void **ptp;
struct ceph_crypto_key new_session_key = { 0 };
struct ceph_buffer *new_ticket_blob;
- unsigned long new_expires, new_renew_after;
+ u32 new_expires, new_renew_after;
u64 new_secret_id;
int ret;
@@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
ceph_decode_timespec(&validity, dp);
dp += sizeof(struct ceph_timespec);
- new_expires = get_seconds() + validity.tv_sec;
+ new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;
new_renew_after = new_expires - (validity.tv_sec / 4);
- dout(" expires=%lu renew_after=%lu\n", new_expires,
+ dout(" expires=%u renew_after=%u\n", new_expires,
new_renew_after);
/* ticket blob for service */
@@ -385,13 +385,13 @@ static bool need_key(struct ceph_x_ticket_handler *th)
if (!th->have_key)
return true;
- return get_seconds() >= th->renew_after;
+ return ktime_get_real_seconds() >= th->renew_after;
}
static bool have_key(struct ceph_x_ticket_handler *th)
{
if (th->have_key) {
- if (get_seconds() >= th->expires)
+ if (ktime_get_real_seconds() >= th->expires)
th->have_key = false;
}
--
2.7.4
next reply other threads:[~2018-06-20 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 10:00 Allen Pais [this message]
2018-06-20 12:33 ` [PATCH] ceph: use ktime_get_real_seconds() Ilya Dryomov
2018-06-20 14:42 ` Allen
2018-06-20 15:47 ` [Y2038] " Arnd Bergmann
2018-06-21 5:41 ` Allen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1529488801-22093-1-git-send-email-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=y2038@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox