From patchwork Fri Apr 8 15:47:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8784251 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 5BD969F36E for ; Fri, 8 Apr 2016 15:47:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89D5B2017D for ; Fri, 8 Apr 2016 15:47:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93FEB20211 for ; Fri, 8 Apr 2016 15:47:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756456AbcDHPrc (ORCPT ); Fri, 8 Apr 2016 11:47:32 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35926 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752727AbcDHPrb (ORCPT ); Fri, 8 Apr 2016 11:47:31 -0400 Received: by mail-pa0-f66.google.com with SMTP id k3so5634099pav.3 for ; Fri, 08 Apr 2016 08:47: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=98QkmiIUfc3GPOBA/MnIfzPRpa3qocwLX09kHeLk93M=; b=b7survVxqt7lDaheinA3KCfgVUhifjUgEn2W4UszQ7MfyFnWrsVMoFcgk6NuBiU+QB sPxCcBqTZ2dGXLfAZt/g2I0dKWHB3wrPXE3UNW569wdocD3fbaHOi3bR65/wL5108YYe HcesQeSUXVgu/nBEsFpTUHK3Onov0nOrPBa3sDd/f9ORNWHiZMISulk3CQuHiMkmN19L Fcci8MrjmkjH3G0skS8OqwCPL5zeElFOqLMeIon1gYgqXe+cSc+EtDSVoFYMjp/HAWeB eYhQpcHvHZk1k/Se7EwZ0cwYeXfq6dn3rnfPLKw34xOkS8rQWeeSW+146F5TLsl8btax /Hqw== 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=98QkmiIUfc3GPOBA/MnIfzPRpa3qocwLX09kHeLk93M=; b=KwvOImaRUnPMAdVsjigdxO17+NpPnN4Qze2grSqMK+W5CN4zrrdmJdxPeVR8nB9H/c z4dqOFQuh76gejRGSOyMFFWKDh47J/d3kpjeRwJ/F5a7cBvge+ISSKFbt0GHp+DdQFeD 3X5snKCt19fQLBfyFYfF9LbvCPC1oabMALI/zTNbt6MzlMI1eJpzDfXLcECjU7JWw5Ur HJcEvJubhJBMPQ5wUCJduvIX2xOI2GxrVnHUihMR8wX7EvcsYncSd/3RwiX98iy6RZU4 LaA+hCtAVO3q5o5wpZxamWu2tns9VAv2aWOYm6c/S2jVFb21zWtfz5XDgsdpM9PeQGRE WjbQ== X-Gm-Message-State: AD7BkJKh8vghZ/bOMgU2dbSq/r5+jXbFZNtr2JZg2aT69Y1Xk0Sl2V0OQtxwrICsmLmFUg== X-Received: by 10.66.141.144 with SMTP id ro16mr13585484pab.137.1460130450515; Fri, 08 Apr 2016 08:47:30 -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 n19sm19617652pfi.53.2016.04.08.08.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Apr 2016 08:47:29 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: tglx@linutronix.de, arnd@arndb.de, viro@zeniv.linux.org.uk Subject: [PATCH 1/2] fs: Add current_fs_time_sec() function Date: Fri, 8 Apr 2016 08:47:10 -0700 Message-Id: <1460130431-7865-2-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460130431-7865-1-git-send-email-deepa.kernel@gmail.com> References: <1460130431-7865-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.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 Reviewed-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 e3c0b7e..fc09058 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1435,6 +1435,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. */