Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1431228
| Path | csiph.com!goblin3!goblin.stu.neva.ru!sewer!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Deepa Dinamani <deepa.kernel@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts |
| Date | Sat, 25 Jun 2016 23:40:02 +0200 |
| Message-ID | <rO3t0-2bb-29@gated-at.bofh.it> (permalink) |
| References | <rO3t0-2bb-7@gated-at.bofh.it> |
| X-Original-To | linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A6h6746MzDj92iyuhgOuaiUz/0Ki2n88m2u7T1SS0wI=; b=fnZbdchCx9JDE6CLU6rpAkEwJDeGIhYLyDjEeWEsWsbpIFbXr/4n5gnWYaaFVpiCtg fVUJsH/Zs8gmWZNuGbz0orlUxLUA1COjwv6sredGhRvABE5RJ/0meDMfZcL0jcRC/lqt yg5VWjWQ53txugTtut/OUn/FnxL02JF5NRdXJh0w4lOuNoH9OZwpkiCqKAD2YTWnSE/e HNssM3cwCVVLOxV9ar+rH+0OBTDOJNCWxnro5Am1ujNC2mKM7KB1ZB/OqZHYAISjb8s3 ookyk06DZOcMN9HtEgUTvBl70JyR1dfiEi6ctz6yluNuoyOlCwWdQjbhJOK1ahif1vai XV8Q== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A6h6746MzDj92iyuhgOuaiUz/0Ki2n88m2u7T1SS0wI=; b=jneBINNA/ylOmvOcxAMhCb8BJLW8ec2hg3c0lhpQIAUQ4pBNwLN4Zluk3ZiUlWBX/K aO5WZztO+fu6krH1hm1BerGhqzMhU2XDofKRM2V/JpdeVUwj5E1M3eAgk75MdM/Km9/g lw+bRzfvbw1B4ISHMl0PAatwxlb4IQhK4m9MKrHVX1o+NQysGQgJ9ghAHwAxhfG21Ppl hSVM8zidtm7oy7IgTMGgFFc84mL2SLM1cIAUn1tjHE3Bye2UqDizsSnOW9/cG4ffaH9X UR7Hh2N4FdyY6DZqBsVuqFahO1awAo6ZGdKAqT3qRkwQm1xKc0r+i7OfEXjlsqjKWXW3 4V3w== |
| X-Gm-Message-State | ALyK8tIPvrfpF/nXac6qOblZbXg7qRQNW6VOhj+GBXB6cEhFmoMfYqnSgObqHs0bfsbycg== |
| X-Received | by 10.66.101.136 with SMTP id fg8mr19924110pab.144.1466890725731; Sat, 25 Jun 2016 14:38:45 -0700 (PDT) |
| X-Mailer | git-send-email 1.9.1 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 70 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | arnd@arndb.de, tglx@linutronix.de, torvalds@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org, "Yan, Zheng" <zyan@redhat.com>, Sage Weil <sage@redhat.com>, Ilya Dryomov <idryomov@gmail.com>, ceph-devel@vger.kernel.org |
| X-Original-Date | Sat, 25 Jun 2016 14:37:45 -0700 |
| X-Original-Message-ID | <1466890668-23400-22-git-send-email-deepa.kernel@gmail.com> |
| X-Original-References | <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1431228 |
Show key headers only | View raw
CURRENT_TIME is not y2038 safe.
The macro will be deleted and all the references to it
will be replaced by ktime_get_* apis.
struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph
uses it internally everywhere.
These references will be changed to use struct timespec64
in a separate patch.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
---
net/ceph/messenger.c | 6 ++++--
net/ceph/osd_client.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index a550289..1825eed 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1366,8 +1366,9 @@ static void prepare_write_keepalive(struct ceph_connection *con)
dout("prepare_write_keepalive %p\n", con);
con_out_kvec_reset(con);
if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) {
- struct timespec now = CURRENT_TIME;
+ struct timespec now;
+ ktime_get_real_ts(&now);
con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2);
ceph_encode_timespec(&con->out_temp_keepalive2, &now);
con_out_kvec_add(con, sizeof(con->out_temp_keepalive2),
@@ -3149,8 +3150,9 @@ bool ceph_con_keepalive_expired(struct ceph_connection *con,
{
if (interval > 0 &&
(con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2)) {
- struct timespec now = CURRENT_TIME;
+ struct timespec now;
struct timespec ts;
+ ktime_get_real_ts(&now);
jiffies_to_timespec(interval, &ts);
ts = timespec_add(con->last_keepalive_ack, ts);
return timespec_compare(&now, &ts) >= 0;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 8946959..44eb2d0 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -3567,7 +3567,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc,
ceph_oid_copy(&lreq->t.base_oid, oid);
ceph_oloc_copy(&lreq->t.base_oloc, oloc);
lreq->t.flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
- lreq->mtime = CURRENT_TIME;
+ ktime_get_real_ts(&lreq->mtime);
lreq->reg_req = alloc_linger_request(lreq);
if (!lreq->reg_req) {
@@ -3625,7 +3625,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc,
ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid);
ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc);
req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
- req->r_mtime = CURRENT_TIME;
+ ktime_get_real_ts(&req->r_mtime);
osd_req_op_watch_init(req, 0, lreq->linger_id,
CEPH_OSD_WATCH_OP_UNWATCH);
--
1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v3 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-25 23:40 +0200
csiph-web