From patchwork Fri Feb 12 09:36:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289471 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 9B3A99FBE9 for ; Fri, 12 Feb 2016 09:39:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C545A203B5 for ; Fri, 12 Feb 2016 09:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0141203C1 for ; Fri, 12 Feb 2016 09:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbcBLJhJ (ORCPT ); Fri, 12 Feb 2016 04:37:09 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33508 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbcBLJhG (ORCPT ); Fri, 12 Feb 2016 04:37:06 -0500 Received: by mail-pf0-f181.google.com with SMTP id q63so44981932pfb.0; Fri, 12 Feb 2016 01:37:06 -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=9nRQjHFHiG6qoej54FSC2JjfQ3jfP+nl4WQfPBZmHiY=; b=LpYGQE4LxHF8gRKuWo4WVangnqxaMlwOnZC0S5tfyYjk0VeI+MAqVahioTmOlrLv6N UXnS3zAkBOO3wplE+FdukDQFwdpM6yf5nea6ee2GOBMx/IaXB0gDvYMavRzCmCL9FDKQ xTCKpW/m3glmMRXi2ECprevMEln1FzTVGXhMOX7bMu7xVlndk1MkA0phJ985npWkvI+Z w/umq4kDib86UxT5j1diAZ/doDHTZoUcKwi5q917cl07/rtzHQI9wQ2sF6eNX/1qi/rt trU0glMoIOE3pDmT2kU3IEbBmAJiF/ZAgHe4Lo6wg4la+bNUtf0eKCxs9qUX5j3/q6/F Hi3g== 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=9nRQjHFHiG6qoej54FSC2JjfQ3jfP+nl4WQfPBZmHiY=; b=YjOolj0r9Bzl1e/UlBZF/hVWrW2RUKytKL9+9oIFgZsOPTkB2uxHG71nCoIyHA49T4 uSs5LmWoG9ILasghJpXHcGcFBPniHVLFZbt2bLawHL+r/McjS9jFSvoNPAn9IzsyGPnz 6t6Oj5KuZYiH2vT0BHypBzojoNmN759lNxi0UjxkqgUN2SOwZhXTiAWcjpVdQHmud7Dq A341shGyREv/GKotGQniBKhWsWdMSS5qv1dqVn7KQJ3ErSfG8MYauKxS2qU16QTXLlTg JfNQ3PxHd4+H7F1S9PF++j0Ipsvowx6w1+zjsf7XdAn1AFzq6XKxKfqwciXf5dbTqCT5 3cBg== X-Gm-Message-State: AG10YORehXodtLxX+k9ZkhSX9jN6VNpkvCbAYlaod1wEZMFymM/VXNiJJTMja5rGTTOAlw== X-Received: by 10.98.42.10 with SMTP id q10mr691463pfq.73.1455269826320; Fri, 12 Feb 2016 01:37:06 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id g25sm17972250pfg.35.2016.02.12.01.36.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:37:05 -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 08/12] fs: btrfs: Change timespec data types to use vfs_time Date: Fri, 12 Feb 2016 01:36:02 -0800 Message-Id: <1455269766-2994-9-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. The following needs to switch along with vfs time representation. 1. inode times set/get. 2. For inode times comparison. 3. getting times from current_fs_time() btrfs_timespec already uses 64 bits to represent seconds in timestamps. The switch to 64 bit using vfs_time will allow for timestamps beyond 2038 to be represented corretly. Signed-off-by: Deepa Dinamani --- fs/btrfs/file.c | 6 +++--- fs/btrfs/ioctl.c | 4 ++-- fs/btrfs/root-tree.c | 2 +- fs/btrfs/transaction.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 610f569..f7d1e14 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1732,16 +1732,16 @@ out: static void update_time_for_write(struct inode *inode) { - struct timespec now; + struct vfs_time now; if (IS_NOCMTIME(inode)) return; now = current_fs_time(inode->i_sb); - if (!timespec_equal(&inode->i_mtime, &now)) + if (!vfs_time_equal(&inode->i_mtime, &now)) inode->i_mtime = now; - if (!timespec_equal(&inode->i_ctime, &now)) + if (!vfs_time_equal(&inode->i_ctime, &now)) inode->i_ctime = now; if (IS_I_VERSION(inode)) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 6f35d9c..471037f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -443,7 +443,7 @@ static noinline int create_subvol(struct inode *dir, struct btrfs_root *root = BTRFS_I(dir)->root; struct btrfs_root *new_root; struct btrfs_block_rsv block_rsv; - struct timespec cur_time = current_fs_time(dir->i_sb); + struct vfs_time cur_time = current_fs_time(dir->i_sb); struct inode *inode; int ret; int err; @@ -4956,7 +4956,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_root_item *root_item = &root->root_item; struct btrfs_trans_handle *trans; - struct timespec ct = current_fs_time(inode->i_sb); + struct vfs_time ct = current_fs_time(inode->i_sb); int ret = 0; int received_uuid_changed; diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index a25f3b2..0a309f6b 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -488,7 +488,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, struct btrfs_root *root) { struct btrfs_root_item *item = &root->root_item; - struct timespec ct = current_fs_time(root->fs_info->sb); + struct vfs_time ct = current_fs_time(root->fs_info->sb); spin_lock(&root->root_item_lock); btrfs_set_root_ctransid(item, trans->transid); diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 37562d6..5481ee0 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1333,7 +1333,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, struct dentry *dentry; struct extent_buffer *tmp; struct extent_buffer *old; - struct timespec cur_time; + struct vfs_time cur_time; int ret = 0; u64 to_reserve = 0; u64 index = 0;