From patchwork Fri Feb 12 09:36:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289391 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 2EC2C9F1C0 for ; Fri, 12 Feb 2016 09:38:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A468203B7 for ; Fri, 12 Feb 2016 09:38:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C5B4203B5 for ; Fri, 12 Feb 2016 09:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbcBLJiU (ORCPT ); Fri, 12 Feb 2016 04:38:20 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33657 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbcBLJhZ (ORCPT ); Fri, 12 Feb 2016 04:37:25 -0500 Received: by mail-pf0-f182.google.com with SMTP id q63so44985913pfb.0; Fri, 12 Feb 2016 01:37:25 -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=4Fwp7aIuy9Weuw8YZehNytx7DPf9UzIn4yM/psGLkPM=; b=V0rN8E3uxcE2hDa/XgBfmy1WQthxvcxPdYBFz1vFI1VlKlSIA6WznvH7nSCFbHoms1 hsZ+UIiWPV/8SUHJRkjKt6VQFb2V5FjJTHp+3+IzGrkSRn1EEcuH3WE4wq+qGYDlTdmO HtxQQ7oB0AHkI/RfMXZUpLJZ7iK+bC9wiW8cCnP+BHU0z97EbKEZAdkLBKsB0JqGIkLx IgRqJsbK9rRmPEUkttS5BRvsFLp7Mr9h4UrL7YcxyeohXitXfCFSonFjp4G5oXCYwHcc oaKTb2gEffRDApLeDw6pQUDgNEmJBVGhxuSfN0OETjAct2kgavHXMQBaYm6R3j966pN2 nXbw== 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=4Fwp7aIuy9Weuw8YZehNytx7DPf9UzIn4yM/psGLkPM=; b=hfCU5wXlm4wGnPw5emguS3jmJFP9F/qei5Rj/bCOKZxa9NOIQ6uMWdNU3m4da8jhi4 URSXQ5lTGOFsMbzsbBua7xaSRlc7fkaBTQAFu8BP18gMZfzDF26QR3udfPS77OD4UdG7 MjpzaP+c11PlAdLA1qnE8dMcacvTRmcmw1QMfYaIGIr8lOgMLVxMVcNcFeS3OIxiYDQa gpHnUsXyHaMkYZM/NZ+qQoNEJlih+XYJWq4dyXsz8U+wlzJxqwyJxwfCv2/rlipZ6iZl 99RTJnyFqiuSUEgKFSJqLoteaX3wcasmJnJw3ZhnYoDXaw72cHdmf0LkHaMe4TWQzWLx yXFA== X-Gm-Message-State: AG10YOQKmor8b8907OBffoGf2ZOJKwlxu8fwYmv0pM2rxfRsga6EINpappURAjzI/ylqbQ== X-Received: by 10.98.75.196 with SMTP id d65mr742196pfj.96.1455269844914; Fri, 12 Feb 2016 01:37:24 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id g25sm17972250pfg.35.2016.02.12.01.37.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:37:24 -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 v2a 12/12] fs: xfs: change inode times to use vfs_time data type Date: Fri, 12 Feb 2016 01:36:06 -0800 Message-Id: <1455269766-2994-13-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455269766-2994-1-git-send-email-deepa.kernel@gmail.com> References: <20160212092153.GA2368@deepa-ubuntu> <1455269766-2994-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 vfs_time aliases here to access inode times. vfs_time is an abstraction that hides the type of timestamps across vfs. This is necessary because we want to change the data types of vfs timestamps to support 64 bit times. current_fs_time() will change along with vfs timestamp data type changes. xfs_vn_update_time() is a .update callback for inode operations and this needs to change along with vfs inode times. All the accesses to or from struct inode timestamps and current_fs_time() are also changed to vfs_time. Signed-off-by: Deepa Dinamani --- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_trans_inode.c | 6 +++--- 3 files changed, 5 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..54fc3c4 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,13 @@ 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;