From patchwork Wed Feb 3 06:07:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8198611 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA6C49F4DD for ; Wed, 3 Feb 2016 06:14:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB3C8201BB for ; Wed, 3 Feb 2016 06:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1716520172 for ; Wed, 3 Feb 2016 06:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933221AbcBCGLC (ORCPT ); Wed, 3 Feb 2016 01:11:02 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36179 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933216AbcBCGLA (ORCPT ); Wed, 3 Feb 2016 01:11:00 -0500 Received: by mail-pf0-f196.google.com with SMTP id n128so534752pfn.3; Tue, 02 Feb 2016 22:10:59 -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=0TNtbuSfJmfY/BfNLAT8bCZgcrYUU7M2z6plxBNcAdU=; b=jbBDK0jb3DF2lpBul39eSnVkdpIYTywkq97WJoyTT0ZH8zxTZ+44QwvxMhs1lw6/Xv nh61qJvF3f50xkEwnM8Sv162hO1Fby1nHDGwEW6R0Kldgk1//FEqpfmIg/FvvQ2E/Shh 226v17XaSJ6he7fOTXw34HBn4pE5afjSzphg74jCYeilxSLtEpQug5LDQpYpZjVel+DX 6T/Qm+Ly8fd5hBxAFWy4dl7SBY5VlZPJzC3gvfmESCHr/U8iriXK4KPmGKKsqWVPssoW bSZtyTv2Gwo3LEC80AuAQUm7YQIRdTjgFTXieRVWEKl/psRDpFpCHi1ovySDw4Lyum97 zsww== 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=0TNtbuSfJmfY/BfNLAT8bCZgcrYUU7M2z6plxBNcAdU=; b=HjuTy/J98ZxSAIjkwBYaCV6H49aTXjnOh78sGj6vmZLJHiRZt+1jimma1xjrVcmmvZ hrCPLRfZtDPiLIftd/5iC9hvOg8j1867F/zz2sI09Z7UvOl96z7XmJ0yOk1Kgt13TIAc 1yI6vSgMAq6/R8o2Z1wI/q92yiFXaRHzfQGTfNng0MXUDQ6byAUZI+go5wOuL2DLlM0h eQ1Qe6UDNCTFxHmsfvlVZI/HNtqJ8L1iQnn+KOA1RNxmzuAI0CrkbIhhtgfQheJ0DJOb +5DIUv2lOHxuj5x6DLH8T9TU/a92FSsqme1PwKARiOe9EDIrwlmm6BbDrOdcH/D4LYLY zJLw== X-Gm-Message-State: AG10YORjSOrSJyPECnJp1qrN0YB/HbC7Aujv5119j34taqT3Tu1ZMbKmBHJ19nP0wryJLg== X-Received: by 10.98.68.86 with SMTP id r83mr33085854pfa.12.1454479859683; Tue, 02 Feb 2016 22:10:59 -0800 (PST) Received: from localhost.localdomain ([106.51.31.224]) by smtp.gmail.com with ESMTPSA id kw10sm6817612pab.0.2016.02.02.22.10.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 22:10:59 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , Dave Chinner , "Theodore Ts'o" , linux-kernel@vger.kernel.org, Alexander Viro Subject: [PATCH 01/10] fs: Add current_fs_time_sec() function Date: Tue, 2 Feb 2016 22:07:41 -0800 Message-Id: <1454479670-8204-2-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com> References: <1454479670-8204-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=-7.2 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 Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 6a75571..4af612f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1407,6 +1407,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. */