From patchwork Fri Feb 12 09:52:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289961 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C09B4BEEE5 for ; Fri, 12 Feb 2016 09:57:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E19B8203AC for ; Fri, 12 Feb 2016 09:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 149EC201F2 for ; Fri, 12 Feb 2016 09:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbcBLJ50 (ORCPT ); Fri, 12 Feb 2016 04:57:26 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35464 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbcBLJzU (ORCPT ); Fri, 12 Feb 2016 04:55:20 -0500 Received: by mail-pf0-f174.google.com with SMTP id c10so45919218pfc.2; Fri, 12 Feb 2016 01:55:20 -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=8MEXJkMCXCmKPdlVHAEu9M77Lj4UF38+TVZMq9xNTao=; b=DaYpXLpYKJzIU4g+XpwMNUWw3gFQzo53JAm0RYfuCyNVGH87cE88La2LA4pYfWR25B P/9VWKBqD+9abfY0//FDu0JOzY7smkSAia8LVmPXBz1ts3Pzcb13Ua1Qde5ZPxiLDrjz jydVX79yKzDKmDU+R135MD8Kdq/hUuDNrPV+F3HQR2vhoaEsjaOOcyXl7y+8dlXw2YfI s5b9wiYh3ktcGVL4DuR+LFsDEvEHtzww/NM8EbEGhXPTgEdjyrFa6xw4tZmRYz3foUX/ JiP/tuMuXoZu6SsWOeFZWyB7zcpeR1hrXcCw0Y/ZeIXZlVhUmgwveYSXfNNi9ayo1RPM ue9g== 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=8MEXJkMCXCmKPdlVHAEu9M77Lj4UF38+TVZMq9xNTao=; b=SYjxprVLDX4oflWOm4jY4N6f73kQqpUgdzJVfoSDwQYLWbc9AKJJjQPpELKPmQXhcj dhYRX2TCefpbqRzvfX7NzPkIBhJQK1LAaVbBis2KPeooQSKp54UDFsz48yx1XCY8xtLk i5fUW973LasIMZrWf/DlpdnPp1dX3mxm4C9vHkmg0mKmholbqKWbSX1rGfis7dV/jKv4 mPtWhXXhN321Hbj93WV8efI9/4fbPnP+LpBLrtENlFgys3wGUXbbhLmaiQSWguC3ywJD wYawB0AuYXIXZSQsY4r+8IDUr3FSz81ag7K9hYXk/JjWKNOk2Reuq5J5VYBAaoYBzaJI IFdw== X-Gm-Message-State: AG10YOT3Jrg38VoLL0nA40cnRob8vqN1KOBPDHrpdOgzw844HdSe6WSe7ACiQ7XTosSQyQ== X-Received: by 10.98.89.78 with SMTP id n75mr815754pfb.120.1455270919934; Fri, 12 Feb 2016 01:55:19 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id xz6sm18090024pab.42.2016.02.12.01.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:55:19 -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 5/8] fs: btrfs: Change btrfs_inode.i_otime to vfs_time data type Date: Fri, 12 Feb 2016 01:52:50 -0800 Message-Id: <1455270773-3249-6-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=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 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. struct btrfs_inode is the in memory inode structure for btrfs. i_otime is a member of the btrfs_inode that represents file creation times. Use struct timespec64 to represent this timestamp. Like all the other inode timestamps in struct inode, i_otime is assigned to/ from disk or struct inode times or 0. Hence, i_otime needs to use accessor functions to access inode timestamps. Signed-off-by: Deepa Dinamani --- fs/btrfs/btrfs_inode.h | 2 +- fs/btrfs/inode.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 61205e3..5200e68 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -190,7 +190,7 @@ struct btrfs_inode { struct btrfs_delayed_node *delayed_node; /* File creation time. */ - struct timespec i_otime; + struct timespec64 i_otime; /* Hook into fs_info->delayed_iputs */ struct list_head delayed_iput; diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 59c0e22..bcd223c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5592,7 +5592,7 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_mtime = current_fs_time(inode->i_sb); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime; - BTRFS_I(inode)->i_otime = inode->i_mtime; + BTRFS_I(inode)->i_otime = vfs_time_to_timespec64(inode->i_mtime); return inode; } @@ -6164,7 +6164,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, inode->i_mtime = current_fs_time(inode->i_sb); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime; - BTRFS_I(inode)->i_otime = inode->i_mtime; + BTRFS_I(inode)->i_otime = vfs_time_to_timespec64(inode->i_mtime); inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], struct btrfs_inode_item);