Skip to content

Commit

Permalink
Replace current_kernel_time64() calls with ktime_get_coarse_real_ts64()
Browse files Browse the repository at this point in the history
  • Loading branch information
modelrockettier committed Jan 31, 2019
1 parent 630b4bb commit fb42e0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion fs/bcachefs/fs.h
Expand Up @@ -70,7 +70,9 @@ static inline unsigned nlink_bias(umode_t mode)

static inline u64 bch2_current_time(struct bch_fs *c)
{
return timespec_to_bch2_time(c, current_kernel_time64());
struct timespec64 ts;
ktime_get_coarse_real_ts64(&ts);
return timespec_to_bch2_time(c, ts);
}

static inline bool inode_attr_changing(struct bch_inode_info *dir,
Expand Down
9 changes: 6 additions & 3 deletions fs/bcachefs/inode.c
Expand Up @@ -251,9 +251,12 @@ void bch2_inode_init(struct bch_fs *c, struct bch_inode_unpacked *inode_u,
uid_t uid, gid_t gid, umode_t mode, dev_t rdev,
struct bch_inode_unpacked *parent)
{
s64 now = timespec_to_bch2_time(c,
timespec64_trunc(current_kernel_time64(),
c->sb.time_precision));
struct timespec64 ts;
s64 now;

ktime_get_coarse_real_ts64(&ts);
now = timespec_to_bch2_time(c,
timespec64_trunc(ts, c->sb.time_precision));

memset(inode_u, 0, sizeof(*inode_u));

Expand Down

0 comments on commit fb42e0d

Please sign in to comment.