summaryrefslogtreecommitdiff
path: root/fs/inode.c
diff options
context:
space:
mode:
authorHao Ge <gehao@kylinos.cn>2023-12-05 09:45:45 +0300
committerChristian Brauner <brauner@kernel.org>2023-12-12 16:24:54 +0300
commiteffa1870b29c39a520c115aa33fd1814e3610249 (patch)
tree5f241181ccc9f6fe03d9fa2758af63e4002bbc4c /fs/inode.c
parente95aada4cb93d42e25c30a0ef9eb2923d9711d4a (diff)
downloadlinux-effa1870b29c39a520c115aa33fd1814e3610249.tar.xz
fs/inode: Make relatime_need_update return bool
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> Link: https://lore.kernel.org/r/20231205064545.332322-1-gehao@kylinos.cn Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 788aa0aa542b..961540b5f16e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1834,37 +1834,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;
}
/**