From patchwork Mon Jun 20 00:27:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9186405 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 95AAC6075E for ; Mon, 20 Jun 2016 01:33:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F6D920748 for ; Mon, 20 Jun 2016 01:33:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70C8F22230; Mon, 20 Jun 2016 01:33:35 +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=ham 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 E53A220748 for ; Mon, 20 Jun 2016 01:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147AbcFTBdd (ORCPT ); Sun, 19 Jun 2016 21:33:33 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35496 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092AbcFTBdb (ORCPT ); Sun, 19 Jun 2016 21:33:31 -0400 Received: by mail-pf0-f196.google.com with SMTP id t190so10313748pfb.2; Sun, 19 Jun 2016 18:33:31 -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=gpBmlKK6lUofYTXmLF++HPN9CzHFcWdA/D24KXui/K/aHES8YtrauNsA2chCUgcZPc j6ks0DteBY+hXN7ifD5qRbCTu5XqxydiJ4kmHdxlvfCAX2oogrZFRi09Ahz69IFQvKvQ DkJ82QdlBKZ4Wiez3gQ4SH+IRbxvsMeKwIbWPPaiNR23Oup/L30JPB2f+OGY64hIa9YL O+PVolj78hLUUG7xnyWA++YIidy37HBm8LbhekT74BJ8DpmCi3UJXI6PW88O+3UYTAf3 vAc7h90o8QBhdZY1wdUzXLGUM1wwja7ECt+b+5U2uYUmgh6kGEGrDl6mlzh7TjPoTVFk dtqQ== 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=LQGCKLLK7AWsV+qBTIXoUK41kP4TSY3Kho6KxT3Ul0+GrZSdLfb5iCrLICHpMk3C5c O8kxz3m7HEfWtXxoI8K20eBH+mXs6v1afaP6Kig8tPFdwyfSzM4NZIN5xGIM+GfDs88p RRi8IxAC45IA/vSubGDloNUNETafnjMhwxm0ErqXsDRmIVIyU0p3tT5L26ez7jRAEnSx Fdeocsa6ikBmq7GJbYJNoNuc1nO1X/KTlI0PllyumVQYh4L5G3dIj32gUltQsaT34Uoq djeLEZ9vFwRJ/sP34rg41+hpI7NuTC/cLPcSzRKzRUnMIqcu83ByecUCpqqWtbEK2a2H QNtw== X-Gm-Message-State: ALyK8tI9qerEIrHLJqdBrWGBlUUXacfhCtIWWLlSum8TiHQcU2UAZnldk1OjHvkhx7VMwA== X-Received: by 10.98.89.147 with SMTP id k19mr18225501pfj.156.1466382521008; Sun, 19 Jun 2016 17:28: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 s12sm34984980pfj.57.2016.06.19.17.28.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 17:28: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 v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts Date: Sun, 19 Jun 2016 17:27:20 -0700 Message-Id: <1466382443-11063-22-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466382443-11063-1-git-send-email-deepa.kernel@gmail.com> References: <1466382443-11063-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);