From patchwork Sat Nov 30 05:30:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55A6F195A for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3233020833 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Npi54+lk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725957AbfK3FbL (ORCPT ); Sat, 30 Nov 2019 00:31:11 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:41627 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfK3FbL (ORCPT ); Sat, 30 Nov 2019 00:31:11 -0500 Received: by mail-pl1-f194.google.com with SMTP id t8so13707372plr.8; Fri, 29 Nov 2019 21:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lm28kIqQgsof6QYEq9ODpPVkMAPFDe+UtXuv02kmoQo=; b=Npi54+lkuw0+YJz8HvLwnAKKaYNdKi562Aa7lPg4NSA5ybdMahLh/p5fJ4oGCwot7/ jakmjx9aPiwG3uFE70HJW3OMyKuTPUyPJLsno9kx14SpVR4/Zg/wNrf0qZz7BCEfyK4z RB09pa/SRRW6eYXgSxQGo86ukHCyB8Lm7/jWNF4x79in9MWzN9sMGWYJPPxCxS6jFvzB W7mDZ1kmrJn+IMYlz9eJGFwF6kh/1QMJOwaMtXxyIlzNDfdr3x3xJBPSNNJCLTGNKmdY 6OrCF6YGaolZKFrcxZT31A+F8LfB+EORE1PoOstQwPOWeftRa5ltQSCaqL9BoHu6MMSp fV7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lm28kIqQgsof6QYEq9ODpPVkMAPFDe+UtXuv02kmoQo=; b=gjdeAvGhr+MQAY3QP/8iIZN/BXEjT+RZMzTbvBhD3h6pRATbiyITd5+8x7i69QSWDv PSsiHGKQKEVp2TqYbPh7/mN48/q/UYwnt7+YRS15D9Cam21X6qpjwbgdkKrsqCypiIQW 7VzTplAigvMqP4t2PGGbItoToNQuOEzREWYgKhTzAGYM66ae1vTigEmNA11sWgDm/8Cu w+3sZ27w8WNhxRetngK3A8r74MFBCy1g1vyr4n9vZXgIgdgVPD7mMZxbz7ANMN0UJTmy LKLChvjdmDYA0PPOi/G0mAlEzFH/1Kas0WNyenfgP7q2sowMEXdh/b7Q9wAm0ofXqPov /0Dg== X-Gm-Message-State: APjAAAX6ulYXAtT5L0PkVYJkwpw5U+wNMB9yUXeZxhUQfzbe+yH2ykdy EY8wvsbRukhH8Lz8EJQ2uDY= X-Google-Smtp-Source: APXvYqwcaA1IcT3cJpggyCqWfO4MBFi0kS8zhv48i031lPPDUZezZFwY9SmFNt4iI6HSg94LJzhiBA== X-Received: by 2002:a17:902:7c04:: with SMTP id x4mr17917267pll.0.1575091870541; Fri, 29 Nov 2019 21:31:10 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:10 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de, hirofumi@mail.parknet.co.jp Subject: [PATCH 1/7] fs: fat: Eliminate timespec64_trunc() usage Date: Fri, 29 Nov 2019 21:30:24 -0800 Message-Id: <20191130053030.7868-2-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org timespec64_trunc() is being deleted. timestamp_truncate() is the replacement api for timespec64_trunc. timestamp_truncate() additionally clamps timestamps to make sure the timestamps lie within the permitted range for the filesystem. But, fat always truncates the times locally after it obtains the timestamps from current_time(). Implement a local version here along the lines of existing truncate functions. Suggested-by: Al Viro Signed-off-by: Deepa Dinamani Cc: hirofumi@mail.parknet.co.jp --- fs/fat/misc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/fat/misc.c b/fs/fat/misc.c index 1e08bd54c5fb..f1b2a1fc2a6a 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -271,6 +271,14 @@ static inline struct timespec64 fat_timespec64_trunc_2secs(struct timespec64 ts) { return (struct timespec64){ ts.tv_sec & ~1ULL, 0 }; } + +static inline struct timespec64 fat_timespec64_trunc_10ms(struct timespec64 ts) +{ + if (ts.tv_nsec) + ts.tv_nsec -= ts.tv_nsec % 10000000UL; + return ts; +} + /* * truncate the various times with appropriate granularity: * root inode: @@ -308,7 +316,7 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) } if (flags & S_CTIME) { if (sbi->options.isvfat) - inode->i_ctime = timespec64_trunc(*now, 10000000); + inode->i_ctime = fat_timespec64_trunc_10ms(*now); else inode->i_ctime = fat_timespec64_trunc_2secs(*now); } From patchwork Sat Nov 30 05:30:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80254139A for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CD2B20833 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MzVVrKj5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726697AbfK3FbO (ORCPT ); Sat, 30 Nov 2019 00:31:14 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:45172 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfK3FbO (ORCPT ); Sat, 30 Nov 2019 00:31:14 -0500 Received: by mail-pj1-f68.google.com with SMTP id r11so6447816pjp.12; Fri, 29 Nov 2019 21:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RG3ZZhL0E9GykGjjrk/4EJEMUcXoBYc4Ti1EdJzmX8c=; b=MzVVrKj56G3Rjx9PNwPCnF05+CWpsp9qOCWIjLhSMVP1H85Jm+kEMq01a3II/SkjeA D2on7ny2E34U4qUzAstO8zqiSbvLyF1I/+6Pgt0bF4b2/OrKnM2tt7myGi3/D4cFMIFo VhHpYU+J/+jA8MkczlPzPLFQYpf1IX1JZdbECnrenXKLVlK2MeWqWAH4YaZIOUI8Gd8z HrJ0QxI6IbWIQOebPB24cRQ7Im6US8lMaYxZo/Esqm6V4VrLcBObUcgiHOCFtNzQGluO NcxS0+A043dL67/NUVptSeAAmdjo0LJIeRQd4zXXKASEkDGZc8/VsCD0TanaTgIFQQ3l H1sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RG3ZZhL0E9GykGjjrk/4EJEMUcXoBYc4Ti1EdJzmX8c=; b=DYk1I1/GKgGIPgZofrq7+eO3VGgDY8WUhQK52DMv+ckXU/5bNlQCLiqK9rHtHCqeZJ 2CoQLWLQJJzjmoIZ2XvxcRW0Nb8VNGYiJixzaiGsldqmhxLW7/0HQ3J+UP+K6IAhYTMQ gYYfqIAjcz2EIuVdC+wUVvp6HtQ6A6ebhJgbZEf7mk03OxaSwwsagGwOhemEpSb8Oe17 Wnfrrrn8atHFXDtNI1tcwGSEDx9XziwVnTPuakQH2kmHwPB1PghZZFuGzPB+lkRPci6j tTrfKjulZwKPq8PcWGE/fMCEbUzWN540BdYmdlEWHR7AzsB0q6ItcPW3LI/CBKxIY2Ta TYiA== X-Gm-Message-State: APjAAAWvhZcz38P/8ObCVlgieDgfMdM/1qIi4+Q6DFilCsZjCDnxoLMq pEfen9l5s2nol7u2jM+8wWk= X-Google-Smtp-Source: APXvYqyGNzC6Z7/nQnWlPRGSKMBzHzH4LiHA8ULIljDDy4dGNrtzcc0t//GYYPmR1cVantfjMqmdvA== X-Received: by 2002:a17:902:be02:: with SMTP id r2mr16885299pls.76.1575091873307; Fri, 29 Nov 2019 21:31:13 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:12 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de, stfrench@microsoft.com, linux-cifs@vger.kernel.org Subject: [PATCH 2/7] fs: cifs: Fix atime update check vs mtime Date: Fri, 29 Nov 2019 21:30:25 -0800 Message-Id: <20191130053030.7868-3-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org According to the comment in the code and commit log, some apps expect atime >= mtime; but the introduced code results in atime==mtime. Fix the comparison to guard against atime Cc: stfrench@microsoft.com Cc: linux-cifs@vger.kernel.org --- fs/cifs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 8a76195e8a69..ca76a9287456 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -163,7 +163,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) spin_lock(&inode->i_lock); /* we do not want atime to be less than mtime, it broke some apps */ - if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime)) + if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime) < 0) inode->i_atime = fattr->cf_mtime; else inode->i_atime = fattr->cf_atime; From patchwork Sat Nov 30 05:30:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B484C921 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8742120833 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hp4AIL/U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbfK3FbS (ORCPT ); Sat, 30 Nov 2019 00:31:18 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36244 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfK3FbQ (ORCPT ); Sat, 30 Nov 2019 00:31:16 -0500 Received: by mail-pg1-f193.google.com with SMTP id k13so15503922pgh.3; Fri, 29 Nov 2019 21:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CmhQS/RvxHM1ZkF3nWKmxpQ+xBfLTIt05/c08FcGCIs=; b=hp4AIL/UwGtuzngGMTZYaxAlp9v/JGnzfyYa/plbFcAmNur5KkDnWK3HMa+z5yG+QZ Q5LxWgOtJXfAmlhcN0aFpuVfsa0evlcQxxe4lAzGeJWQmunAaZliLQ8kLX01VfmL+CnP pBre+WkAYg2CuUGA5ujfw9014QCVR96BCcPDEyeYyCB6OczBOee0gUs3jwC9Bp2hRBsO MaPBbWltKWMECRYznYlWa0xsAn0jKiSwY1F16Ksg8YxZQBDMN2VJA6dxFAwGoqayddJ8 WKcM2vahApMvlhVohv0kXTPCmnT/nb73fP0CwGfWLgwDMCsq51/CGC69YtH39slcCM/2 QSiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CmhQS/RvxHM1ZkF3nWKmxpQ+xBfLTIt05/c08FcGCIs=; b=V/PEF6F68oSK0OmBCxjUEsfjEF1W1YjTc4HIHW+6NHdLlUtoAaXzDxsPYnwy7Pu0jA V8ZCIxspSuoJYfG3axIJ9Q2vh5bfHc5G0sulmldmmwKF/CdktxwPpaovt/TKLrLF7I3t IOivHfkrgwm6ccVkMCIMjW5gAXca6LWnGyDvm81NxxG4wsNRHfNElTfj2tshzOv+1Evh p8K9BNBnq7JxG6GJvqWy+VuyLzHuGwknT71vnhc8U6cBS/s5KO8Fi3q9zxLq0D0s/KF0 Q2E6o3o0LYk+U3bMRkDuAXyGX89KGp5y1pWiO87SwSIn27VPq/Z/r/o/RG5xcoQq8Vsl Rekg== X-Gm-Message-State: APjAAAXfXEu1x63Y02eRs8Pg5eLqNq5Fm0VgaR4BYP4rqhdariwpc03z KOANkrFSLnQl7zDifNeC3ogfP35R X-Google-Smtp-Source: APXvYqzeGM2sPKH5IIE/oT9bZrPKO3zy52iiEg+grtcMiCeaPDDZKlj2ye7F1vCWVAMIZiWVhHR+aA== X-Received: by 2002:a63:4b52:: with SMTP id k18mr20132223pgl.394.1575091875879; Fri, 29 Nov 2019 21:31:15 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:15 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de, stfrench@microsoft.com, linux-cifs@vger.kernel.org Subject: [PATCH 3/7] fs: cifs: Delete usage of timespec64_trunc Date: Fri, 29 Nov 2019 21:30:26 -0800 Message-Id: <20191130053030.7868-4-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org timestamp_truncate() is the replacement api for timespec64_trunc. timestamp_truncate() additionally clamps timestamps to make sure the timestamps lie within the permitted range for the filesystem. Truncate the timestamps in the struct cifs_attr at the site of assignment to inode times. This helps us use the right fs api timestamp_trucate() to perform the truncation. Also update the ktime_get_* api to match the one used in current_time(). This allows for timestamps to be updated the same way always. Signed-off-by: Deepa Dinamani Cc: stfrench@microsoft.com Cc: linux-cifs@vger.kernel.org --- fs/cifs/inode.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ca76a9287456..026ed49e8aa4 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -113,6 +113,7 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) } /* revalidate if mtime or size have changed */ + fattr->cf_mtime = timestamp_truncate(fattr->cf_mtime, inode); if (timespec64_equal(&inode->i_mtime, &fattr->cf_mtime) && cifs_i->server_eof == fattr->cf_eof) { cifs_dbg(FYI, "%s: inode %llu is unchanged\n", @@ -162,6 +163,9 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) cifs_revalidate_cache(inode, fattr); spin_lock(&inode->i_lock); + fattr->cf_mtime = timestamp_truncate(fattr->cf_mtime, inode); + fattr->cf_atime = timestamp_truncate(fattr->cf_atime, inode); + fattr->cf_ctime = timestamp_truncate(fattr->cf_ctime, inode); /* we do not want atime to be less than mtime, it broke some apps */ if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime) < 0) inode->i_atime = fattr->cf_mtime; @@ -329,8 +333,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; fattr->cf_uid = cifs_sb->mnt_uid; fattr->cf_gid = cifs_sb->mnt_gid; - ktime_get_real_ts64(&fattr->cf_mtime); - fattr->cf_mtime = timespec64_trunc(fattr->cf_mtime, sb->s_time_gran); + ktime_get_coarse_real_ts64(&fattr->cf_mtime); fattr->cf_atime = fattr->cf_ctime = fattr->cf_mtime; fattr->cf_nlink = 2; fattr->cf_flags = CIFS_FATTR_DFS_REFERRAL; @@ -609,10 +612,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, if (info->LastAccessTime) fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime); - else { - ktime_get_real_ts64(&fattr->cf_atime); - fattr->cf_atime = timespec64_trunc(fattr->cf_atime, sb->s_time_gran); - } + else + ktime_get_coarse_real_ts64(&fattr->cf_atime); fattr->cf_ctime = cifs_NTtimeToUnix(info->ChangeTime); fattr->cf_mtime = cifs_NTtimeToUnix(info->LastWriteTime); From patchwork Sat Nov 30 05:30:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF0B517E0 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBA7C20833 for ; Sat, 30 Nov 2019 05:31:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z8gfwWDS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727167AbfK3FbU (ORCPT ); Sat, 30 Nov 2019 00:31:20 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:39179 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfK3FbT (ORCPT ); Sat, 30 Nov 2019 00:31:19 -0500 Received: by mail-pj1-f68.google.com with SMTP id v93so11028566pjb.6; Fri, 29 Nov 2019 21:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3yGQn+iiQJUO9GKnXnkOFOtv94PHfEunM5yutQgfYz4=; b=Z8gfwWDS8fngo0CFYRMI015w2/aTU/TwhQBZ+GkrJmW2J2tl0dtjKq77JKCJEBIe8M z5JKNnjm4fQpc/BgJHwU8quoC4dJNYcXtIPK2uwWV4aHVHH2Nch31BduJliDB7WzvIjW NDZHRKK5K1NyYWLQn6aN7Ln0her5Bx08tYOxUB8hRXTMM3Q6km6m+L0WjVNjRSwpFaQn lz+KW6jAZKJn8VxO5FQr83MSDA8KaLeuQ0MWM2OCJXjOGLxI+hpobbvXuOERN1oEfQ25 nWCypGglQ92bPPZKDUePE9h5/PmcyrenxXht9bBQHJTrKK1lpAbUOyKObNnw/xguypS1 k/YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3yGQn+iiQJUO9GKnXnkOFOtv94PHfEunM5yutQgfYz4=; b=XEzp6WSQOyXmMME0S0sNI01Y4S0WQslCYkHWCZzEJXOCNt9Klstua1oooAyxwx/ZFK O7/+TvrIHvnWAjAd5HWrZKYz8wi9HfoPZuYu3xyQFvgmA+D1ltTwyojxNcRZxfkGctb2 Fys+ueF6e1/YxHK4D8q54upt0OkFIp7YsO3V4OK2HA0utyqr+WAZKu+bQj0LT0uFGfQA dMUlYYI4wppxbBX+3aS+vywjDF8/IFINsQY4xM8ONZG2gQjc+WNHrM6p0X5aOqIpjEJs hbGMHWL2CfkrFKKmRRVJBJwhsA8v4k9Zr6Ao0TKJ63bu6K8mnb+effz5xlfBZdaT4CAV OouQ== X-Gm-Message-State: APjAAAVaTPF1wb4Cev2IPU6je/djORUWCY27AeLZ6EBvOnT2Qrm/j3Bq SNCvQ+G1CtxawtCgqa8tDfw= X-Google-Smtp-Source: APXvYqwjTogqYXJ/8/ZBbuTkMsannOQsuO+jop3OO+IlN09OCUIHRza2bNsjA5C6osCWH3aSy1CMgg== X-Received: by 2002:a17:90a:2a44:: with SMTP id d4mr22653988pjg.91.1575091878527; Fri, 29 Nov 2019 21:31:18 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:18 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de, jlayton@kernel.org, ceph-devel@vger.kernel.org Subject: [PATCH 4/7] fs: ceph: Delete timespec64_trunc() usage Date: Fri, 29 Nov 2019 21:30:27 -0800 Message-Id: <20191130053030.7868-5-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Since ceph always uses ns granularity, skip the truncation which is a no-op. Signed-off-by: Deepa Dinamani Cc: jlayton@kernel.org Cc: ceph-devel@vger.kernel.org --- fs/ceph/mds_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 068b029cf073..c2aa290f6c3e 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2088,8 +2088,7 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) init_completion(&req->r_safe_completion); INIT_LIST_HEAD(&req->r_unsafe_item); - ktime_get_coarse_real_ts64(&ts); - req->r_stamp = timespec64_trunc(ts, mdsc->fsc->sb->s_time_gran); + ktime_get_coarse_real_ts64(&req->r_stamp); req->r_op = op; req->r_direct_mode = mode; From patchwork Sat Nov 30 05:30:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 120A3921 for ; Sat, 30 Nov 2019 05:31:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1D4420833 for ; Sat, 30 Nov 2019 05:31:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QTBT8UKK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727230AbfK3Fb1 (ORCPT ); Sat, 30 Nov 2019 00:31:27 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46183 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727213AbfK3FbX (ORCPT ); Sat, 30 Nov 2019 00:31:23 -0500 Received: by mail-pf1-f193.google.com with SMTP id 193so15630039pfc.13; Fri, 29 Nov 2019 21:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Vw3rC7pffNNcciKNW8GALTh1NKcZNgUJHxJWIV46+IQ=; b=QTBT8UKK9yUITRVyFfiYMom5BZg89YGsEzgcN6Ysm4CvfNOo1aUz9n83Bt2HWsz5LM nRyX1eeWgFXLJKlPkpmyyju0gEUuWJ0X0v6fgyh/HuWx9WJOWxyIJ5+j0upSMpupRdQh pMM0oanTxpjUBVKYEI9vcqAAOEnRGt7G/7VR4kBBVYQ1/4L7AktgC0zSLB+1OO9WWpEg GU6bKa7qCf9HcrUuEubih9LUwQfFCfpnyqbywLQs12WvQV0BEtdptgpXs8RHA6VfHTcH VriOGXHIOpd1+HAZL86mfD73n3063vP0YD8EIHCljzpubRjfwiN/VnKRAivE2x4v01Nw sIAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Vw3rC7pffNNcciKNW8GALTh1NKcZNgUJHxJWIV46+IQ=; b=ZN9lj5kqcdD2HNmjC3ce6wrHBbiI33BjY2UgjkfO+fZG5i6k0629UARWt/u7slXDcL nJh8LH50M+4KAQ9LLSeA9rlPjbLiZnHB9zJ9uknKKu1Em64oAPuFO7YFlInwlpau0nzO PV7PTOlZkXMnADaCoBPeJfMuAJu9EssvPhdJknVxfxrhqCsE69aXYolwjSXKwp7I6hnT mh44ScMhj19iF+THLeFklIceQik0sXZt/OM5vZ09Y8dV7tF5r3WROTB0tP0T2vQy7kcn 2kVKGi8C2BANYecz8ZKaPIWtkW8GDbnT8bqYe99ffsHyAf6GwB5sCmz4YGXimWJExZ8J v8ZA== X-Gm-Message-State: APjAAAXoxGoq4fzd72/XamhG1xKC7jbBKeLmen0lKMkiPfknJhfjOPFY ac+r2Aag5PCQO3yLeTJidRE= X-Google-Smtp-Source: APXvYqyKLE9MPEOfva5JmfnqKbKoz5o2n2ZiCUAM4Gm+j89Z0YMto0rYLtIj75X10hjrQIYJyzB12Q== X-Received: by 2002:a65:58ce:: with SMTP id e14mr263048pgu.153.1575091880926; Fri, 29 Nov 2019 21:31:20 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:20 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de, richard@nod.at, linux-mtd@lists.infradead.org Subject: [PATCH 5/7] fs: ubifs: Eliminate timespec64_trunc() usage Date: Fri, 29 Nov 2019 21:30:28 -0800 Message-Id: <20191130053030.7868-6-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org DEFAULT_TIME_GRAN is seconds granularity. We can just drop the nsec while creating the default root node. Delete the unneeded call to timespec64_trunc(). Also update the ktime_get_* api to match the one used in current_time(). This allows for the timestamps to be updated by using the same ktime_get_* api always. Signed-off-by: Deepa Dinamani Cc: richard@nod.at Cc: linux-mtd@lists.infradead.org --- fs/ubifs/sb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 2b7c04bf8983..93d550be4c11 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -84,7 +84,6 @@ static int create_default_filesystem(struct ubifs_info *c) int idx_node_size; long long tmp64, main_bytes; __le64 tmp_le64; - __le32 tmp_le32; struct timespec64 ts; u8 hash[UBIFS_HASH_ARR_SZ]; u8 hash_lpt[UBIFS_HASH_ARR_SZ]; @@ -291,16 +290,14 @@ static int create_default_filesystem(struct ubifs_info *c) ino->creat_sqnum = cpu_to_le64(++c->max_sqnum); ino->nlink = cpu_to_le32(2); - ktime_get_real_ts64(&ts); - ts = timespec64_trunc(ts, DEFAULT_TIME_GRAN); + ktime_get_coarse_real_ts64(&ts); tmp_le64 = cpu_to_le64(ts.tv_sec); ino->atime_sec = tmp_le64; ino->ctime_sec = tmp_le64; ino->mtime_sec = tmp_le64; - tmp_le32 = cpu_to_le32(ts.tv_nsec); - ino->atime_nsec = tmp_le32; - ino->ctime_nsec = tmp_le32; - ino->mtime_nsec = tmp_le32; + ino->atime_nsec = 0; + ino->ctime_nsec = 0; + ino->mtime_nsec = 0; ino->mode = cpu_to_le32(S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO); ino->size = cpu_to_le64(UBIFS_INO_NODE_SZ); From patchwork Sat Nov 30 05:30:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80888921 for ; Sat, 30 Nov 2019 05:31:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EB59208E4 for ; Sat, 30 Nov 2019 05:31:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nvdSmCcx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727237AbfK3Fb1 (ORCPT ); Sat, 30 Nov 2019 00:31:27 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36724 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfK3FbZ (ORCPT ); Sat, 30 Nov 2019 00:31:25 -0500 Received: by mail-pf1-f195.google.com with SMTP id b19so15669457pfd.3; Fri, 29 Nov 2019 21:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BHTDtxvEiYFTLiebbwUbRtrN28Hzzvb20uPHKGc+/WM=; b=nvdSmCcxewXb1BHkTf3gNGqhYckwmrhVf8sXKug1CmL/BhlLAWtirBwk07cfOKmNNK UvO4QkqaPKn9cAZNrimKfT/w+nAa5O+LExr3EaaeUNonvW6TPRMN8chEZPUdeS5pLiEG p/zTTvUd4/1xZBvVkJP96VUi3GaDy08lqQquNuJubzrdeK99b6LXoCMZyEZpLk9NqBzq 4epOErCHZ+iBzz0BO6rtrR8wnsDYhW1uMHvXqQHZNxEUpsIYj4G48hoG/Ofl6QQtdtfP 0OmJTU7MXP3Mbw6FPSqUQGjf8PEN+meZogOLuTvoIiuMHrUkrtgwVTCoL9oJFmKxuyQG BAsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BHTDtxvEiYFTLiebbwUbRtrN28Hzzvb20uPHKGc+/WM=; b=q4H2s5oACaSb6TcjP59548VVS7HJRLGKXXt9l2y5JMkruqBCiZlQOMXOCm4AMBGFZU zxIsYRkV/80grAnDmePlmzOlAOIwgANOyh7nhV0Syr42d6Z07CCNyTHhE4p1dLYvK7Ir LfCcpIeGuQjDIJIpywrqkFfyp4TLIe9QKNB0wPXKObrdNLqvNg8CBz/98VAFPpdImfGK hOci8g4rR2Xvsmfo/rsPn5PlXr59dx3Ec36cw0TXH9Uj0Oj+Jv4YGg/SBmJbcikqJ6Yc 2ovD2kRvMCGZkMGkEtcOFTLj0PSeXo8/Y5DgUR/ZPlti6CgJkvzPL8VOq8bFBKvpv/ML O8Kg== X-Gm-Message-State: APjAAAVLXFqstjgtTMbm5e7awV5MvpY4wqyb4ZqfMhCc81zS3qG7CyJn 0dd9jNM8KAsY2RpKFBlRhIoUEwGD X-Google-Smtp-Source: APXvYqwHAbVakfZAzkoRLCz096tq6L6dpSEor/4JiHH6Fc3UMoPDj4kgzHx2H0Kfc+D0nljOe9z/qg== X-Received: by 2002:a63:31d0:: with SMTP id x199mr21005232pgx.286.1575091883825; Fri, 29 Nov 2019 21:31:23 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:23 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de Subject: [PATCH 6/7] fs: Delete timespec64_trunc() Date: Fri, 29 Nov 2019 21:30:29 -0800 Message-Id: <20191130053030.7868-7-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org There are no more callers to the function remaining. Signed-off-by: Deepa Dinamani --- fs/inode.c | 24 ------------------------ include/linux/fs.h | 1 - 2 files changed, 25 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index fef457a42882..12c9e38529c9 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2145,30 +2145,6 @@ void inode_nohighmem(struct inode *inode) } EXPORT_SYMBOL(inode_nohighmem); -/** - * timespec64_trunc - Truncate timespec64 to a granularity - * @t: Timespec64 - * @gran: Granularity in ns. - * - * Truncate a timespec64 to a granularity. Always rounds down. gran must - * not be 0 nor greater than a second (NSEC_PER_SEC, or 10^9 ns). - */ -struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran) -{ - /* Avoid division in the common cases 1 ns and 1 s. */ - if (gran == 1) { - /* nothing */ - } else if (gran == NSEC_PER_SEC) { - t.tv_nsec = 0; - } else if (gran > 1 && gran < NSEC_PER_SEC) { - t.tv_nsec -= t.tv_nsec % gran; - } else { - WARN(1, "illegal file time granularity: %u", gran); - } - return t; -} -EXPORT_SYMBOL(timespec64_trunc); - /** * timestamp_truncate - Truncate timespec to a granularity * @t: Timespec diff --git a/include/linux/fs.h b/include/linux/fs.h index 98e0349adb52..46dd7e6f6d73 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1575,7 +1575,6 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid); } -extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran); extern struct timespec64 current_time(struct inode *inode); /* From patchwork Sat Nov 30 05:30:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 11267851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F841139A for ; Sat, 30 Nov 2019 05:31:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEB7020833 for ; Sat, 30 Nov 2019 05:31:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GjKAdtVX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727296AbfK3Fbe (ORCPT ); Sat, 30 Nov 2019 00:31:34 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34477 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbfK3Fb2 (ORCPT ); Sat, 30 Nov 2019 00:31:28 -0500 Received: by mail-pf1-f194.google.com with SMTP id n13so15671278pff.1; Fri, 29 Nov 2019 21:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ct1pKB7FU+wUU8p27F21GOP7pXY7j1OGt/UKg2jU0Qk=; b=GjKAdtVXfq1SUOKKHV6uM+o7Ir/oL77R35zWiNxQ4vvzhYGSZldwpomQFCjxaJCrZA H8x2ElRY6ZXSAPFEKRdXKb2pkelIV3L8Z5BOhogmrneB6vQWmC6TNUqdQCYMwXxR9ptS XjrMjEl8aE2XqV+MsF8Ktm+i0t7zY1hPyP6vF+y5qG78LeOKHswOCVGbC7UfAdp4/ZBM KCid1BeXONTCBre4U9GtLf5Zw9ELQ4zYfal4R40xAODB3sYiCckGNyqSADbI7fvn0/lo 8uMXuAsxJhZ0Bv8QaCDBMnOxnPBu28i1IugGVPB4Vw7vQ8GOhbQ+DsEtbyvWpEr2YzYN lnyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ct1pKB7FU+wUU8p27F21GOP7pXY7j1OGt/UKg2jU0Qk=; b=rdqx2Ktu+15erawFL2B13IMbtP2336K4+wuag9Z7Ak/FlMwLwVaL+6bmey7HOUiGp5 n+KrVhRfPbhJfTaTGysPuzgCHrM0/PNstjY1hRVXd3Ejgq7gcnx+yMGi5rAYe4Dto4ar GeolCQN0hyFQUlNCvv+UYbZHFeVwPWUnPzTcKj1T4slc8qCBKrQuTPLxcSJ+m8Un2B7I 1VRPWIylqVEUT5bF+V7tj4wuK2fDP+KKHrgCEB4Sm0AhUtvla9GAsynuuyUZDEVT2mwg zo61ezYmg6x7qkMz9vkTJp+RtI5eGYzsQIFLUZRssTCG8UrJGomfQL7vUDuUgqiUOpmv B0Fw== X-Gm-Message-State: APjAAAWvNeLqd9ktAVVfeJKi7QfocZwmSgHsbeXGUjGS012F825Xf0xL gs0S0QjIvyaUfBgMMmUkYPw= X-Google-Smtp-Source: APXvYqywYNXT+HjYM3+qM1kZ50+JF+iAYvZO17IQsx1+SGD8J024RAly9Qidaj7yZTgkZleUYwvUAg== X-Received: by 2002:a63:845:: with SMTP id 66mr20496575pgi.368.1575091886520; Fri, 29 Nov 2019 21:31:26 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id a13sm26131734pfi.187.2019.11.29.21.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 21:31:26 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, arnd@arndb.de Subject: [PATCH 7/7] fs: Do not overload update_time Date: Fri, 29 Nov 2019 21:30:30 -0800 Message-Id: <20191130053030.7868-8-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191130053030.7868-1-deepa.kernel@gmail.com> References: <20191130053030.7868-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org update_time() also has an internal function pointer update_time. Even though this works correctly, it is confusing to the readers. Use a different name for the local variable. Suggested-by: Al Viro Signed-off-by: Deepa Dinamani --- fs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 12c9e38529c9..0be58a680457 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1675,12 +1675,12 @@ EXPORT_SYMBOL(generic_update_time); */ static int update_time(struct inode *inode, struct timespec64 *time, int flags) { - int (*update_time)(struct inode *, struct timespec64 *, int); + int (*cb)(struct inode *, struct timespec64 *, int); - update_time = inode->i_op->update_time ? inode->i_op->update_time : + cb = inode->i_op->update_time ? inode->i_op->update_time : generic_update_time; - return update_time(inode, time, flags); + return cb(inode, time, flags); } /**