* [PATCH] f2fs: avoid using timespec
@ 2017-10-19 9:52 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-10-19 9:52 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu
Cc: y2038, Deepa Dinamani, linux-fsdevel, Arnd Bergmann, DongOh Shin,
Eric Biggers, Tomohiro Kusumi, linux-f2fs-devel, linux-kernel
All uses of timespec are deprecated, and this one is not particularly
useful, as the documented method for converting seconds to jiffies
is to multiply by 'HZ'.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/f2fs/f2fs.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 4b4a72f392be..b9a4a5db426c 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1178,8 +1178,7 @@ static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
{
- struct timespec ts = {sbi->interval_time[type], 0};
- unsigned long interval = timespec_to_jiffies(&ts);
+ unsigned long interval = sbi->interval_time[type] * HZ;
return time_after(jiffies, sbi->last_time[type] + interval);
}
--
2.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] f2fs: avoid using timespec
@ 2017-10-19 9:52 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-10-19 9:52 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu
Cc: Arnd Bergmann, Eric Biggers, y2038, linux-kernel,
linux-f2fs-devel, Deepa Dinamani, linux-fsdevel, DongOh Shin,
Tomohiro Kusumi
All uses of timespec are deprecated, and this one is not particularly
useful, as the documented method for converting seconds to jiffies
is to multiply by 'HZ'.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/f2fs/f2fs.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 4b4a72f392be..b9a4a5db426c 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1178,8 +1178,7 @@ static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
{
- struct timespec ts = {sbi->interval_time[type], 0};
- unsigned long interval = timespec_to_jiffies(&ts);
+ unsigned long interval = sbi->interval_time[type] * HZ;
return time_after(jiffies, sbi->last_time[type] + interval);
}
--
2.9.0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: avoid using timespec
2017-10-19 9:52 ` Arnd Bergmann
(?)
@ 2017-10-22 14:55 ` Chao Yu
-1 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2017-10-22 14:55 UTC (permalink / raw)
To: Arnd Bergmann, Jaegeuk Kim, Chao Yu
Cc: Eric Biggers, y2038, linux-kernel, linux-f2fs-devel,
Deepa Dinamani, linux-fsdevel, DongOh Shin, Tomohiro Kusumi
On 2017/10/19 17:52, Arnd Bergmann wrote:
> All uses of timespec are deprecated, and this one is not particularly
> useful, as the documented method for converting seconds to jiffies
> is to multiply by 'HZ'.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
> ---
> fs/f2fs/f2fs.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 4b4a72f392be..b9a4a5db426c 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -1178,8 +1178,7 @@ static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
>
> static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
> {
> - struct timespec ts = {sbi->interval_time[type], 0};
> - unsigned long interval = timespec_to_jiffies(&ts);
> + unsigned long interval = sbi->interval_time[type] * HZ;
>
> return time_after(jiffies, sbi->last_time[type] + interval);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-22 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 9:52 [PATCH] f2fs: avoid using timespec Arnd Bergmann
2017-10-19 9:52 ` Arnd Bergmann
2017-10-22 14:55 ` [f2fs-dev] " Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.