Commit bcb6f6d2 authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: use timespec64

And check for valid nsec value before passing into timespec64_to_jiffies().
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent f75fdf22
...@@ -63,11 +63,15 @@ static inline u64 fuse_dentry_time(struct dentry *entry) ...@@ -63,11 +63,15 @@ static inline u64 fuse_dentry_time(struct dentry *entry)
/* /*
* Calculate the time in jiffies until a dentry/attributes are valid * Calculate the time in jiffies until a dentry/attributes are valid
*/ */
static u64 time_to_jiffies(unsigned long sec, unsigned long nsec) static u64 time_to_jiffies(u64 sec, u32 nsec)
{ {
if (sec || nsec) { if (sec || nsec) {
struct timespec ts = {sec, nsec}; struct timespec64 ts = {
return get_jiffies_64() + timespec_to_jiffies(&ts); sec,
max_t(u32, nsec, NSEC_PER_SEC - 1)
};
return get_jiffies_64() + timespec64_to_jiffies(&ts);
} else } else
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment