From patchwork Wed Mar 2 15:31:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8482041 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A3031C0553 for ; Wed, 2 Mar 2016 15:32:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6B2020125 for ; Wed, 2 Mar 2016 15:32:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 986C320103 for ; Wed, 2 Mar 2016 15:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752567AbcCBPcI (ORCPT ); Wed, 2 Mar 2016 10:32:08 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36383 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbcCBPcH (ORCPT ); Wed, 2 Mar 2016 10:32:07 -0500 Received: by mail-pf0-f196.google.com with SMTP id q129so6687740pfb.3 for ; Wed, 02 Mar 2016 07:32:07 -0800 (PST) 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=GgJrJz2K9alYRHHfNQjGOp0ON/x6wb3IZbWZJ3O8pNE=; b=EZffKSzxLcaQPWo+XUog0ujGgo6rMPTQlDbhlSB1vWucEnRZbgeklRqP+D7xGEv41b A7OInxyCqyQj61O2rZB0qv7x8ZMIWuLdfRzlxpqr1gGL7XlPfKvzUqJXlx1IpfutPEOh DAP7MVosSroW3B6tgUKC44iVkofm45QKzJDft87bqqsXxq0ODIroG7f6jCOtL5CjAbYW Pl5azTO7aiLhp5o99P/yxaVKcpS88VccL9OdYaHquKhcvB6EAe5t5F15YkHgEFbWpvb5 QsT3eWDDqasdLwKUsV82/zkzz3yhlmq26kkk7Fcavbja9bAuFEXjpXmx+ACyvxUPaLtE xvGg== 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=GgJrJz2K9alYRHHfNQjGOp0ON/x6wb3IZbWZJ3O8pNE=; b=c8XXRf6TREpkTpahrTXXejz6HtfTDsMEvpimqS0awEma7pKsYL3VKIPeRpINpsnDk+ kapyeb3zrP4jbXVwf5AxNcCPyye0fO+nY1NRKwZbifF/dioo5ZZuGQbigCBwV3NgV2NF SFVnIEMgMEuGeTPX4Ak5VM0PeQhUhgJ/BjhYZS1xK5SG/TX7L1RB36OPpPZl7OT/G8HG tBkvlFNSUPuXIqg8BS2zXOUd9wYdWLPJFtrcC2gFPUQ6Rlk/MqqaxtB04rVSpR9PnodL Gq06Rr4UNf4LgOSNQ4wlzuf82crmvpkmPKMvdEkR3lxaw39cQhYeS76JTN1uBEf1Kdxe Cx9g== X-Gm-Message-State: AD7BkJKrickB1WqwJoUOahZBmSS3wOr6RTeTl1rO3zZJL5lmzzEdD7FVA7tVghgxQMiwcQ== X-Received: by 10.98.10.204 with SMTP id 73mr12487759pfk.87.1456932726954; Wed, 02 Mar 2016 07:32:06 -0800 (PST) Received: from localhost.localdomain ([106.51.225.232]) by smtp.gmail.com with ESMTPSA id xn8sm804770pab.15.2016.03.02.07.32.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 07:32:06 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: viro@zeniv.linux.org.uk, tglx@linutronix.de, arnd@arndb.de Subject: [PATCH 1/2] fs: Add current_fs_time_sec() function Date: Wed, 2 Mar 2016 07:31:49 -0800 Message-Id: <1456932710-10926-2-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456932710-10926-1-git-send-email-deepa.kernel@gmail.com> References: <1456932710-10926-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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe. The function is meant to replace CURRENT_TIME_SEC macro. The macro CURRENT_TIME_SEC does not represent filesystem times correctly as it cannot perform range checks. current_fs_time_sec() will be extended to include these. CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec() will be transitioned to use 64 bit time along with vfs in a separate series. The function is inline for now to maintain similar performance to that of the macro. The function takes super block as a parameter to allow for future range checking of filesystem timestamps. Signed-off-by: Deepa Dinamani Acked-by: Arnd Bergmann --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 1af4727..e0b29d4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1404,6 +1404,11 @@ struct super_block { extern struct timespec current_fs_time(struct super_block *sb); +static inline struct timespec current_fs_time_sec(struct super_block *sb) +{ + return (struct timespec) { get_seconds(), 0 }; +} + /* * Snapshotting support. */