From patchwork Sat Jun 25 21:37:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9198735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE022608A7 for ; Sat, 25 Jun 2016 21:39:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4F8E28527 for ; Sat, 25 Jun 2016 21:39:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98EA728529; Sat, 25 Jun 2016 21:39:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DFE728529 for ; Sat, 25 Jun 2016 21:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbcFYVjU (ORCPT ); Sat, 25 Jun 2016 17:39:20 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35624 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbcFYViv (ORCPT ); Sat, 25 Jun 2016 17:38:51 -0400 Received: by mail-pa0-f65.google.com with SMTP id hf6so11940810pac.2; Sat, 25 Jun 2016 14:38:46 -0700 (PDT) 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) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id m8sm1861308pfi.27.2016.06.25.14.38.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Jun 2016 14:38:45 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org 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" , Sage Weil , Ilya Dryomov , ceph-devel@vger.kernel.org Subject: [PATCH v3 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts Date: Sat, 25 Jun 2016 14:37:45 -0700 Message-Id: <1466890668-23400-22-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> References: <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: "Yan, Zheng" Cc: Sage Weil Cc: Ilya Dryomov 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);