From patchwork Fri Feb 12 09:52:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289901 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 178F99F3CD for ; Fri, 12 Feb 2016 09:56:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 477D2203AC for ; Fri, 12 Feb 2016 09:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 625D2201F2 for ; Fri, 12 Feb 2016 09:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbcBLJ4I (ORCPT ); Fri, 12 Feb 2016 04:56:08 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35155 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751571AbcBLJzg (ORCPT ); Fri, 12 Feb 2016 04:55:36 -0500 Received: by mail-pa0-f51.google.com with SMTP id ho8so44669888pac.2; Fri, 12 Feb 2016 01:55:36 -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=h3o4lc8vhWbIf80dt/rrnxEl9YtXO+Nb9DxcShaSKHw=; b=MZnmX2VHUFMWwh7flbFrIvHmWl0gXPsRPSef0BAn3sUcPsz0gRGIbsLz9eMnw0o3Qj QzKIP++uO3JfsfOV9uUzZJPQTnYPbYYSCORI/L/TzQX6AY+gUYFJuOtip4xg6+53eD5C dvOQI/8VIEoAKRiIEl4DGr/qCkO/X7SsHQkL8gCzxEq+fuNOxJ7wKOevRJgH5AeaZ9uO SvWvpjAU/xa5PjAClOMxwMZS9ai/nKUUWaGjwSMKbIn/mGbQ2ihjhqZv2P+IZEG5O2Wk wuiUy0Qaj8SILrMeaUIcSrmJWzI3an1E4CTCvxZzmrKeoFecMqHS3JItSmrKadQ1EY9B kcsg== 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=h3o4lc8vhWbIf80dt/rrnxEl9YtXO+Nb9DxcShaSKHw=; b=T6ojKG/NC9/F4QNgHZFY1kLQhJvBhBFfySiowFg2+1/hy5CMblqHx/pTuO4rIFjfMo jW4yavQ278sXG1xP1ZTmpBS7t+TAo1nNKqO8nPnCeNnjiuZ/80DN/vlPfscNkNlAKvyv L8SngbYZcGU5TZ9ERR5IP2CvinLthwDL1iBhMoMCPgxFtGtQKXNNC5yZRwJzOkjl4xg9 w9A+yYu2GoeMDKZcGmdaNl2O3aFOQNtFz6ganaVAB82VZ+H+Lt++klB7u2VFqXZqLIA1 Y7WucFPh5Hbq/hXcK9qMjSeSMF5ZuOyvvROM9zqjZyhgFRRrDNvsHeXF6fh7qPGk3ZAL BGyA== X-Gm-Message-State: AG10YOR7WD9izqJlLtkUNDr77jtt3lY3EvchlaG0dIm5oHC+Uv9f4Y5hoEfwV15EzUJfQg== X-Received: by 10.66.190.40 with SMTP id gn8mr812567pac.64.1455270935768; Fri, 12 Feb 2016 01:55:35 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id xz6sm18090024pab.42.2016.02.12.01.55.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:55:35 -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 Subject: [RFC v2c 8/8] fs: xfs: change inode times to use vfs_time data type Date: Fri, 12 Feb 2016 01:52:53 -0800 Message-Id: <1455270773-3249-9-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455270773-3249-1-git-send-email-deepa.kernel@gmail.com> References: <20160212092153.GA2368@deepa-ubuntu> <1455270773-3249-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.9 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=unavailable 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 The VFS inode timestamps are not y2038 safe as they use struct timespec. These will be changed to use struct timespec64 instead and that is y2038 safe. But, since the above data type conversion will break the end file systems, use timespec64 and conversion functions here to access inode times. All the timestamps are converted to use struct timespec64 data type. And, all the vfs timestamps are converted to timespec64 at the boundary of vfs. Signed-off-by: Deepa Dinamani --- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_trans_inode.c | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ceba1a8..ebf76a3 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -765,7 +765,7 @@ xfs_ialloc( xfs_inode_t *ip; uint flags; int error; - struct timespec tv; + struct vfs_time tv; /* * Call the space management code to pick diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 76b71a1..7f8a897 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -973,7 +973,7 @@ xfs_vn_setattr( STATIC int xfs_vn_update_time( struct inode *inode, - struct timespec *now, + struct vfs_time *now, int flags) { struct xfs_inode *ip = XFS_I(inode); diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index b97f1df..1242502 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c @@ -68,7 +68,7 @@ xfs_trans_ichgtime( int flags) { struct inode *inode = VFS_I(ip); - struct timespec tv; + struct vfs_time tv; ASSERT(tp); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); @@ -76,13 +76,14 @@ xfs_trans_ichgtime( tv = current_fs_time(inode->i_sb); if ((flags & XFS_ICHGTIME_MOD) && - !timespec_equal(&inode->i_mtime, &tv)) { + !vfs_time_equal(&inode->i_mtime, &tv)) { inode->i_mtime = tv; ip->i_d.di_mtime.t_sec = tv.tv_sec; ip->i_d.di_mtime.t_nsec = tv.tv_nsec; } + if ((flags & XFS_ICHGTIME_CHG) && - !timespec_equal(&inode->i_ctime, &tv)) { + !vfs_time_equal(&inode->i_ctime, &tv)) { inode->i_ctime = tv; ip->i_d.di_ctime.t_sec = tv.tv_sec; ip->i_d.di_ctime.t_nsec = tv.tv_nsec;