diff mbox series

fs/inode: Make relatime_need_update return bool

Message ID 20231205064545.332322-1-gehao@kylinos.cn (mailing list archive)
State New, archived
Headers show
Series fs/inode: Make relatime_need_update return bool | expand

Commit Message

Hao Ge Dec. 5, 2023, 6:45 a.m. UTC
relatime_need_update should return bool to consistent with the function
__atime_needs_update that is caller

Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 fs/inode.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Christian Brauner Dec. 5, 2023, 11:08 a.m. UTC | #1
On Tue, 05 Dec 2023 14:45:45 +0800, Hao Ge wrote:
> relatime_need_update should return bool to consistent with the function
> __atime_needs_update that is caller
> 
> 

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] fs/inode: Make relatime_need_update return bool
      https://git.kernel.org/vfs/vfs/c/f957e74dd3bb
diff mbox series

Patch

diff --git a/fs/inode.c b/fs/inode.c
index f238d987dec9..c0b50cdf7154 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1836,37 +1836,37 @@  EXPORT_SYMBOL(bmap);
  * earlier than or equal to either the ctime or mtime,
  * or if at least a day has passed since the last atime update.
  */
-static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
+static bool relatime_need_update(struct vfsmount *mnt, struct inode *inode,
 			     struct timespec64 now)
 {
 	struct timespec64 atime, mtime, ctime;
 
 	if (!(mnt->mnt_flags & MNT_RELATIME))
-		return 1;
+		return true;
 	/*
 	 * Is mtime younger than or equal to atime? If yes, update atime:
 	 */
 	atime = inode_get_atime(inode);
 	mtime = inode_get_mtime(inode);
 	if (timespec64_compare(&mtime, &atime) >= 0)
-		return 1;
+		return true;
 	/*
 	 * Is ctime younger than or equal to atime? If yes, update atime:
 	 */
 	ctime = inode_get_ctime(inode);
 	if (timespec64_compare(&ctime, &atime) >= 0)
-		return 1;
+		return true;
 
 	/*
 	 * Is the previous atime value older than a day? If yes,
 	 * update atime:
 	 */
 	if ((long)(now.tv_sec - atime.tv_sec) >= 24*60*60)
-		return 1;
+		return true;
 	/*
 	 * Good, we can skip the atime update:
 	 */
-	return 0;
+	return false;
 }
 
 /**