From patchwork Thu Jun 9 05:05:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9166265 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 B38E260467 for ; Thu, 9 Jun 2016 05:10:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5AF526490 for ; Thu, 9 Jun 2016 05:10:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A58C28294; Thu, 9 Jun 2016 05:10:22 +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 501C126490 for ; Thu, 9 Jun 2016 05:10:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945999AbcFIFHi (ORCPT ); Thu, 9 Jun 2016 01:07:38 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36513 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426567AbcFIFGD (ORCPT ); Thu, 9 Jun 2016 01:06:03 -0400 Received: by mail-pf0-f194.google.com with SMTP id 62so2027728pfd.3; Wed, 08 Jun 2016 22:06:02 -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=Pszx1Eq4fDYmTvXtQoKMFRUcrY+vzruZslEbX9KgFoI=; b=mNIGfNW/Q6HhlsBtXTTB6+FMV5KPlYbwt5jICLkrMyP9SSWmRNwcCWirhZPcODpwBS ao3UO0NZBJCShZ5nazQNBgwt69ow1c9tTOKn5xsqZMoHm0BKYbYit5S+sMA81pZJGpU6 WNPTIMfuM+xCQqLuTxU8vHkmf9ELSAR89IE82Thzz9+J0++jfeR3D0wVhoYVnI7gmdFR 7CM3ODiKpvqpYuz4cl6XhRji/y44Uyz82ZPSxILyb/ByxRNoOToiTD8EIqvdHQWGkNvF FsZaKOrd5pxRQ3YWyX1UHDfxZsS5yGe9WswDImpURh+R1POboLo+oauZ5+3E+hxXzEba C6JA== 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=Pszx1Eq4fDYmTvXtQoKMFRUcrY+vzruZslEbX9KgFoI=; b=IkgGrwXyybQIHOBnFw8K3+Ka3rtYV262hwgtXRUALWWEVOZQQPSv+8VmK9fwmZtyvd XuxzpNL+OIHKlFTG6iCPtcbKihcnPBiMXw+7x9dyzUVVm6oeeeaudGRsQJoXV5LiyRX9 QPpaifHN4lvMd/xYinlKzby2z4bLCxpTHcyY9KFDRy7lYf6+/PM5P4iVeBnsxGiRhjrV WIg43u2pzAOT2PmCAZwAR0/L40dYm8I6zL0axOBbysWvL6yNPUf/BZPxEBCxKV0m39ze 0Uj0bDw7p3JzzhmACu57cQ7E+IRiJ01eEOaf7EutZdcNfkI1nWdhRIGq/7GK/4LEZ0j1 1bWQ== X-Gm-Message-State: ALyK8tJ2i9I3Uf7oB22gBZwdoEnAK78mIArwfsllZjCCOxz7foNZCuydzKq0gRifp4w8lg== X-Received: by 10.98.13.65 with SMTP id v62mr2602479pfi.91.1465448762306; Wed, 08 Jun 2016 22:06:02 -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 129sm6220808pfe.3.2016.06.08.22.06.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 22:06:01 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Thomas Gleixner , Al Viro , Linus Torvalds , y2038@lists.linaro.org, "Yan, Zheng" , Sage Weil , Ilya Dryomov , ceph-devel@vger.kernel.org Subject: [PATCH 19/21] libceph: Remove CURRENT_TIME references Date: Wed, 8 Jun 2016 22:05:03 -0700 Message-Id: <1465448705-25055-20-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com> References: <1465448705-25055-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 ++++-- 1 file changed, 4 insertions(+), 2 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;