From patchwork Thu Jun 9 05:04:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9166215 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 70F8960467 for ; Thu, 9 Jun 2016 05:07:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63A0326490 for ; Thu, 9 Jun 2016 05:07:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5850F28294; Thu, 9 Jun 2016 05:07:14 +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 D53ED26490 for ; Thu, 9 Jun 2016 05:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426592AbcFIFGV (ORCPT ); Thu, 9 Jun 2016 01:06:21 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36483 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426213AbcFIFFz (ORCPT ); Thu, 9 Jun 2016 01:05:55 -0400 Received: by mail-pf0-f195.google.com with SMTP id 62so2027463pfd.3; Wed, 08 Jun 2016 22:05:55 -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=C1W5149r53PUJ5fTVBMcjKXfu5jNYR1m4QR3t02jD9A=; b=iYOInejMxkOfBFO791+UT98XBL1j3ZKJNrqmCi9THZ/HrNHWL2ecB3u2hfptS57L0S iURbglq4jyoxB8iNKxCDXiLU2yQyKObb+Vu3H2qavWzEcSraQcfFwTIuvIFxEL5BpC3B bJVFvM2E0RJETHzR88WwbJKzkcRTk8fvQSl2ICG+ZcZBm5IGZNHwkOdKEgPVn39f/JSm hUn0bXHyNzy1/b3dg+JBP64hJaPTmCaM4d0tHMnIqUA4+SIx9EykDEla+6r5nR1u0ai/ 7DfRfniaucavQSXblk9UdtKoTaunQ0utyT53W997d2aMcUiTpyWW+59mUNYXdx4mk3Pd fp6g== 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=C1W5149r53PUJ5fTVBMcjKXfu5jNYR1m4QR3t02jD9A=; b=CYvS5p/BEdUDLA/YRX1SzYsu8M+aA6O90C5nCCSVDZu1U2tRr99nOPjAfE+DrylNQ4 aMG9M9ndFeGI0ilVwujdGUCOeGFdMGiYat9tjSY6k0pCvU45nhoEiC+tihBR9RGVZfZW p9nFOj1t63npCuAnJ8C0ahFAgDlDXehP8JBvRi/Jxi+BRVR2Mb3+vY19JEsBtT0rODq1 aiepIAOVbwdE/AtuAtgy8eVUSnFhxUt6Tfd2zFEixsYi0s2FFX3PTj1H2DShKq/UUMQU lpqlGep0Mm4tRcP8vKH8VCLP0YExTmdBtzKDBlbK46JlZkyGxQGu2XNHFs3/CKIgI9LM sJYQ== X-Gm-Message-State: ALyK8tLCgJf0jpexlJv29p8aEDf6aqAW0hGIKW0leBK1adhwCy4R7e9ez5wwAhs/6+8CMw== X-Received: by 10.98.11.4 with SMTP id t4mr2487699pfi.159.1465448754799; Wed, 08 Jun 2016 22:05:54 -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.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 22:05:54 -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, Mark Fasheh , Joel Becker , ocfs2-devel@oss.oracle.com Subject: [PATCH 13/21] fs: ocfs2: Use time64_t to represent orphan scan times Date: Wed, 8 Jun 2016 22:04:57 -0700 Message-Id: <1465448705-25055-14-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: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct timespec is not y2038 safe. Use time64_t which is y2038 safe to represent orphan scan times. time64_t is sufficient here as only the seconds delta times are relevant. Also use appropriate time functions that return time in time64_t format. Time functions now return monotonic time instead of real time as only delta scan times are relevant and these values are not persistent across reboots. The format string for the debug print is still using long as this is only the time elapsed since the last scan and long is sufficient to represent this value. Signed-off-by: Deepa Dinamani Cc: Mark Fasheh Cc: Joel Becker Cc: ocfs2-devel@oss.oracle.com --- fs/ocfs2/journal.c | 4 ++-- fs/ocfs2/ocfs2.h | 2 +- fs/ocfs2/super.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index e607419..df76e60 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -1946,7 +1946,7 @@ static void ocfs2_queue_orphan_scan(struct ocfs2_super *osb) */ seqno++; os->os_count++; - os->os_scantime = CURRENT_TIME; + os->os_scantime = ktime_get_seconds(); unlock: ocfs2_orphan_scan_unlock(osb, seqno); out: @@ -2003,7 +2003,7 @@ void ocfs2_orphan_scan_start(struct ocfs2_super *osb) struct ocfs2_orphan_scan *os; os = &osb->osb_orphan_scan; - os->os_scantime = CURRENT_TIME; + os->os_scantime = ktime_get_seconds(); if (ocfs2_is_hard_readonly(osb) || ocfs2_mount_local(osb)) atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE); else { diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index e63af7d..7e5958b 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -224,7 +224,7 @@ struct ocfs2_orphan_scan { struct ocfs2_super *os_osb; struct ocfs2_lock_res os_lockres; /* lock to synchronize scans */ struct delayed_work os_orphan_scan_work; - struct timespec os_scantime; /* time this node ran the scan */ + time64_t os_scantime; /* time this node ran the scan */ u32 os_count; /* tracks node specific scans */ u32 os_seqno; /* tracks cluster wide scans */ atomic_t os_state; /* ACTIVE or INACTIVE */ diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index d7cae33..dc56f07 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -337,7 +337,7 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) out += snprintf(buf + out, len - out, "Disabled\n"); else out += snprintf(buf + out, len - out, "%lu seconds ago\n", - (get_seconds() - os->os_scantime.tv_sec)); + (unsigned long)(ktime_get_seconds() - os->os_scantime)); out += snprintf(buf + out, len - out, "%10s => %3s %10s\n", "Slots", "Num", "RecoGen");