From patchwork Sat Aug 13 22:48:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9278699 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 DB92D60780 for ; Sun, 14 Aug 2016 10:25:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCC40289C0 for ; Sun, 14 Aug 2016 10:25:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF64F28A1E; Sun, 14 Aug 2016 10:25:26 +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 56BE6289C0 for ; Sun, 14 Aug 2016 10:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbcHNKZJ (ORCPT ); Sun, 14 Aug 2016 06:25:09 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33229 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbcHNKZH (ORCPT ); Sun, 14 Aug 2016 06:25:07 -0400 Received: by mail-pa0-f66.google.com with SMTP id vy10so2012526pac.0; Sun, 14 Aug 2016 03:25:07 -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=DpMvJ7CBBBi/ZlCruXwye6+Q0sw78cmJpufk8dOhv6s=; b=BNSG2kkFqBOSHEkJRGOKyLy/ihIu/dwST/eE/r4cq7qfGVcd0Aw7UjfFN//iEPv24S 5thWMXTJM+6EJ1Sqeu2cVmS+HvYz5vfTNzTeHcv0wAW86GQdmGcn0luR91pF4yvimuVx phzwPBYG6XLaVzNU7xYK7LuAAUcQEOaj7e8jw6PO1kkcyk7iHb/l4MG7O9SzKdOGbPqE h2pL1jeDszGungZVx6NwWcK58yrpSfJUqY5APnUGklN0fjr50MwiCWar1OLZFQFkuBoZ s8mQLh1VYhtFmfDUtN/y7wCgUtoPC/n7lB+NEKJ+6JM1h+KoXkKTJl5MSfy7TRKmiwUd O2Zg== 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=DpMvJ7CBBBi/ZlCruXwye6+Q0sw78cmJpufk8dOhv6s=; b=M1WLWVkLsGNn5vX+HW3YjgARlOBQMghXAVCqKXh6is3J4uSlEDQjayMFjeX1cPnNr7 LpNtL/SFGaUYmV4Ykxl2E6lSl6G84ZarIVRX0lK5gCcAKhGq4ax20O3yKVffAod/OubO jt2PeTozVTbG5IGHzskEx1YirAA4aZaegu4fNgWNBHHO0PXmjLIMtJA2FuRUpIS/iaTc e/oawAYSxLat/3N5Lb9gEEGj1FpnmGolAcdkzfRLmfjPysVQA/vKGKOIzHpbRMdi9GiE e+zdKItq+gVi8puDd7doNob4gQiES5Jlw2ofndJwUI/VXRGK85yLyRydLEWU1TJrBCK3 26PQ== X-Gm-Message-State: AEkoousuP3PKmiDjzAl+NRuVE0AzX4745KrmP2ixviaaAPOEdA+2GkpEPShX6tlX9/WkSA== X-Received: by 10.66.43.164 with SMTP id x4mr39499162pal.11.1471128581102; Sat, 13 Aug 2016 15:49:41 -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 81sm22528007pfm.90.2016.08.13.15.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 15:49:40 -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 v4 22/26] libceph: Replace CURRENT_TIME with ktime_get_real_ts Date: Sat, 13 Aug 2016 15:48:34 -0700 Message-Id: <1471128518-24075-23-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> References: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 Reviewed-by: Arnd Bergmann 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 a97e7b5..a99bcdb 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -3600,7 +3600,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) { @@ -3658,7 +3658,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);