Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1368718imm; Fri, 17 Aug 2018 17:35:30 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzd4o9icNx8yg9ckQ+xLKTHfP4HAkm8s1jrMm99ZnIMwjXprSCzQeNmRfPOtaL8GvoF4NCG X-Received: by 2002:a17:902:bb97:: with SMTP id m23-v6mr29394740pls.215.1534552530227; Fri, 17 Aug 2018 17:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534552530; cv=none; d=google.com; s=arc-20160816; b=euZ2B0KHAzfpAC9Cx0WK/DejOUwpIfJeidUMyiPdvR6nkY6IdzORn9eckMjUbTH9/c GTGlxTOntMXq4ztGFrgsUVdIgr6Qo+/GBzG/s1UU06ktE4yYvhiAwOfroWQI5eBIgLbO ba8wn5SGl7ozsHZdfyQOVPLZ8Sr4PU8tO3S2l8xCrmTvusrL/XcB5VfWLDbq9Fx4oGir dsdIi4jqc4SrJA+QopkNPxct340nsNlRNRgf9Ydmwb68YQmYZjUnLapDLtldunhWHSzl k6n0VVoWG6uzsaH/U4gPM9qcA1mFyODwrfb1w2vMxhCsK0B9PYdB8PZ18nKlDbFkkSxf LZEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id:date :subject:cc:to:from:arc-authentication-results; bh=bmLphF4SZVIlC/Wt05huqm4gQseecxEh/J63eAv0HOI=; b=A+0tSQ3RcRT7IvjDmPsiGTD/4TmSgzfyQpbjLhx6n9xkQTlehiCK+DbRAffus3hepL SnK1y04m3zX9NbT0o5C6NGSQUAMi5D7Fir8cPQ+4p1SXHVXTyAc3EJGwesxdyAJKzL/L P41yRIc0fKr3aBUifFVRS9PLMQGNAj7bsbmOcTqp4ArXVydtm85V0FlgZxTxhXDumPVg 8ylS3pZCfRoBORkmzImVatsPvgyCdr5huh8Y9f0qZNYvluRyaLYeoSgVbY8ug9lih1HL kSGW54U0xbfUbuwlxE7PV1yJ/JSy1jKPwF+0S8mM+yRSaIt9alWdi/Ic1ArEBET0AlBR QFvQ== 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 127-v6si3344079pgi.38.2018.08.17.17.35.14; Fri, 17 Aug 2018 17:35:30 -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 S1726743AbeHRDjr (ORCPT + 99 others); Fri, 17 Aug 2018 23:39:47 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:60790 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbeHRDjr (ORCPT ); Fri, 17 Aug 2018 23:39:47 -0400 Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id 96DBB15AF4C; Sat, 18 Aug 2018 09:34:10 +0900 (JST) Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w7I0Y9Ys017949 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Aug 2018 09:34:10 +0900 Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w7I0Y9Bu004260 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Aug 2018 09:34:09 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.15.2/8.15.2/Submit) id w7I0Y89t004259; Sat, 18 Aug 2018 09:34:08 +0900 From: OGAWA Hirofumi To: Andrew Morton Cc: Arnd Bergmann , Jeff Layton , linux-kernel@vger.kernel.org Subject: [PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch Date: Sat, 18 Aug 2018 09:34:07 +0900 Message-ID: <87zhxkjyww.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Looks like I missed the email to read for a patch (mmots/broken-out/fat-propagate-64-bit-inode-timestamps.patch). Well, so FWIW, Acked-by: OGAWA Hirofumi And additionally cleanup patch here (this would be better to be folded into his patch). Thanks. -- OGAWA Hirofumi [PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch - Remove useless temporary variable - Remove needless long long Signed-off-by: OGAWA Hirofumi --- fs/fat/inode.c | 10 +++------- fs/fat/misc.c | 7 +++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff -puN fs/fat/inode.c~fat-propagate-64-bit-inode-timestamps-cleanup fs/fat/inode.c --- linux/fs/fat/inode.c~fat-propagate-64-bit-inode-timestamps-cleanup 2018-08-18 09:23:27.990137305 +0900 +++ linux-hirofumi/fs/fat/inode.c 2018-08-18 09:32:52.629008507 +0900 @@ -509,7 +509,6 @@ static int fat_validate_dir(struct inode int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) { struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); - struct timespec64 ts; int error; MSDOS_I(inode)->i_pos = 0; @@ -559,14 +558,11 @@ int fat_fill_inode(struct inode *inode, inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) & ~((loff_t)sbi->cluster_size - 1)) >> 9; - fat_time_fat2unix(sbi, &ts, de->time, de->date, 0); - inode->i_mtime = ts; + fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); if (sbi->options.isvfat) { - fat_time_fat2unix(sbi, &ts, de->ctime, + fat_time_fat2unix(sbi, &inode->i_ctime, de->ctime, de->cdate, de->ctime_cs); - inode->i_ctime = ts; - fat_time_fat2unix(sbi, &ts, 0, de->adate, 0); - inode->i_atime = ts; + fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); } else inode->i_ctime = inode->i_atime = inode->i_mtime; diff -puN fs/fat/misc.c~fat-propagate-64-bit-inode-timestamps-cleanup fs/fat/misc.c --- linux/fs/fat/misc.c~fat-propagate-64-bit-inode-timestamps-cleanup 2018-08-18 09:23:27.992137301 +0900 +++ linux-hirofumi/fs/fat/misc.c 2018-08-18 09:32:52.596008572 +0900 @@ -180,7 +180,7 @@ int fat_chain_add(struct inode *inode, i #define IS_LEAP_YEAR(y) (!((y) & 3) && (y) != YEAR_2100) /* Linear day numbers of the respective 1sts in non-leap years. */ -static time64_t days_in_year[] = { +static long days_in_year[] = { /* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 0, 0, 0, }; @@ -191,8 +191,7 @@ void fat_time_fat2unix(struct msdos_sb_i { u16 time = le16_to_cpu(__time), date = le16_to_cpu(__date); time64_t second; - long day, leap_day, month; - long long year; + long day, leap_day, month, year; year = date >> 9; month = max(1, (date >> 5) & 0xf); @@ -207,7 +206,7 @@ void fat_time_fat2unix(struct msdos_sb_i second = (time & 0x1f) << 1; second += ((time >> 5) & 0x3f) * SECS_PER_MIN; second += (time >> 11) * SECS_PER_HOUR; - second += (year * 365 + leap_day + second += (time64_t)(year * 365 + leap_day + days_in_year[month] + day + DAYS_DELTA) * SECS_PER_DAY; _