From patchwork Wed Jun 20 08:02:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139290 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp498730lji; Wed, 20 Jun 2018 01:31:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK9I/dgZedxavp+9QaWH+2pXbyjwbGeaJF7Fvvc6v4K2jgFNMid4YAzeKNU3ELfdwhWIJYv X-Received: by 2002:a17:902:8d8b:: with SMTP id v11-v6mr22945849plo.20.1529483485440; Wed, 20 Jun 2018 01:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529483485; cv=none; d=google.com; s=arc-20160816; b=M9cJ1PBRYM12IAKIizW9c6e/n+TYRwwW8/ijp0X6sxkC1xNwgZK5rVckcL9zHYWoJF CHj0POfzz2veRMuKR7Tl17nJbN+vBz1cKiEZuWQlui/CIsX8wMu3wTw/Hke398C7jSSL tuyzE3Uin4Q1+YcGPgzvi8/YuRS4PhYnDDsISfrcjb9CiDe9LMQsXuGuPelalwptYn1i pxz/7o8/1Wbe4WSnM2qmZlgrFOheEWnPW0hKVAtAhhyrlLFeuKqz0R0g2wGOOytILfLg rxhaSUucyMHv+0mRfyx0zPT/F827O+o0rDcskhrIbtJXcqJPoX8nFG3zaUCG9rgyqaHD 1WxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ykSUP0zthvfdeTdF4V1kUEn63w32jNLUCyEcAP2s99c=; b=TZ2o1tbNBR9D3rYiy1fhYL9j25rDKJGwA7uzwcMrCH0WQ+bH/F4WncP87jiHhwTWNL CK8uLwI+YFym0a7Dr/JvgmZjCAenlzjGKkzJz6NYDUy6MZGEL/wz5FbSNwB/p1+WL6kS pMuCp/1jpsWsQXbIqWxJv8GN37ZJw9kw5M9eq1z2vMMgxf6gdqGRz3PW0fnPWYnnHY5b b5uS1QsHn3/nRtYD4oPQdwDMwHNM90WuvNHh5W8JByYwcjh6XPtvdghTNq8v6t9ptiuR 0fiYODi13TUfgeB2zRjXoZjy2oKewc5wg/ZorxlUJoXFagxtCxuByE4ANngSx3YjYacx nA0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14-v6si1943831pfd.207.2018.06.20.01.31.25; Wed, 20 Jun 2018 01:31:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754253AbeFTIbX (ORCPT + 30 others); Wed, 20 Jun 2018 04:31:23 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:44227 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753321AbeFTIbU (ORCPT ); Wed, 20 Jun 2018 04:31:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M1ohG-1gJn650fLG-00tobA; Wed, 20 Jun 2018 10:06:07 +0200 From: Arnd Bergmann To: Jaegeuk Kim , Chao Yu Cc: y2038@lists.linaro.org, Arnd Bergmann , Sheng Yong , Eric Biggers , "Theodore Ts'o" , Yunlei He , Deepa Dinamani , Yunlong Song , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: use timespec64 for inode timestamps Date: Wed, 20 Jun 2018 10:02:19 +0200 Message-Id: <20180620080603.4156809-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:euVe48uQ7fhYAIxYwhwLE6D+Tm69XWN5ugITgY1lJG6DmUF1JmC fqUy2OCFPhzpnZw5JzadZXGdyok3p+7UA0cqqadOSSyVLmkGNPRbhLsEwtX4qwBwDMk3mGf /DH7UcOj1B4opuZaM1DtrDeNiOC09M91pb+Rkg54DU6UmAJ6VvFUpFX168jZ2Kg3+I4Q33x any73YonO0E2mrreBjAnw== X-UI-Out-Filterresults: notjunk:1; V01:K0:VFI5UkHt4h4=:r4gn/Eq0oyx+oBAsLr5h+5 Si7qxy+T5xk26czEPnIM7R2+kINPPtn6YRXCIxgLahLNQGIXZLQxpIon7qPUWDdH+NwPHyt85 r88dYvyzyxU5nfqMAta/NGN9RDRD+QVJph8Ou9NGhASxeRP3vVaji1f2FTuIglF2K/RHnmvmv kcopTPddtD+FEbRPZDBnaSO+vPvICRDFzg6LIsqJT3Tf1RV1akHHj173nwSDBjKO/TzCnsh/M hLneW3CSzfteGC/3LP8an1sFwlkSO4qdNVNqhbCKPcXfDQ0/NPB1xMw+1AdtgoHhisuYcxe87 J1H/ye7kigHHdaW3YYOpuWLlPC2TdEMJTrXLs0SjNSF6RZt57EhcWfQ995RlhvKGAMkHBz8hq hspayxyAR7vYAianjYz9T4B30xTaG0Z2Gp+lHngqJzn1MDpwgMvLl4MRRncAQ+LPkNeXZumdj YeVAhg7GgCcqyX8iBO2PUt8l/ISujOadqKSqm3UpujF9soHhIdPgJTPRcRB5/l8q6CnRZXybT KG+dwr5TkcyMguqtn0/D9LqcY9th/e3XWlq7UI7b5MDn3GqZNVUlWfD8RiVj6oCRkyf0+GvQv 2XqNBh3VLtHpVFV5vNRYg4Ip7B75RdhDZ/Gd2+s6m4hH2r8JSJughpEuRHsPyIB5NpKwtK7xH fZ9PMSxf9WzYf7jxA1XDSIXM4XCUH1eFukbohUx0kiiuwNY+CKsH8wngTR9lR+q6pSl4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The on-disk representation and the vfs both use 64-bit tv_sec values, so let's change the last missing piece in the middle. Signed-off-by: Arnd Bergmann --- fs/f2fs/f2fs.h | 16 ++++++---------- fs/f2fs/inode.c | 12 ++++++------ fs/f2fs/namei.c | 2 +- 3 files changed, 13 insertions(+), 17 deletions(-) -- 2.9.0 Reviewed-by: Chao Yu diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4d8b1de83143..8b519707433b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -669,8 +669,8 @@ struct f2fs_inode_info { int i_extra_isize; /* size of extra space located in i_addr */ kprojid_t i_projid; /* id for project quota */ int i_inline_xattr_size; /* inline xattr size */ - struct timespec i_crtime; /* inode creation time */ - struct timespec i_disk_time[4]; /* inode disk times */ + struct timespec64 i_crtime; /* inode creation time */ + struct timespec64 i_disk_time[4];/* inode disk times */ }; static inline void get_extent_info(struct extent_info *ext, @@ -2518,7 +2518,6 @@ static inline void clear_file(struct inode *inode, int type) static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) { - struct timespec ts; bool ret; if (dsync) { @@ -2534,16 +2533,13 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) i_size_read(inode) & ~PAGE_MASK) return false; - ts = timespec64_to_timespec(inode->i_atime); - if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts)) + if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) return false; - ts = timespec64_to_timespec(inode->i_ctime); - if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts)) + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime)) return false; - ts = timespec64_to_timespec(inode->i_mtime); - if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts)) + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) return false; - if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3, + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3, &F2FS_I(inode)->i_crtime)) return false; diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f121c864f4c0..30a777369d2b 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -297,9 +297,9 @@ static int do_read_inode(struct inode *inode) fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); } - F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); - F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); - F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); + F2FS_I(inode)->i_disk_time[0] = inode->i_atime; + F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; + F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; f2fs_put_page(node_page, 1); @@ -470,9 +470,9 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) if (inode->i_nlink == 0) clear_inline_node(node_page); - F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); - F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); - F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); + F2FS_I(inode)->i_disk_time[0] = inode->i_atime; + F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; + F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; } diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 231b7f3ea7d3..2ea0de4cbe76 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -51,7 +51,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) inode->i_ino = ino; inode->i_blocks = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); - F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime); + F2FS_I(inode)->i_crtime = inode->i_mtime; inode->i_generation = sbi->s_next_generation++; if (S_ISDIR(inode->i_mode))