diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-07-13 22:18:35 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-08-02 21:26:12 +0200 |
commit | 63ecae7e439f766e88c91da56955bca4db06802a (patch) | |
tree | ad3e8cada4e40718062322da390c3e2a438c38f1 /fs/ceph | |
parent | 473bd2d780d1699d81b25f57c0ec4de633a28eb8 (diff) | |
download | linux-63ecae7e439f766e88c91da56955bca4db06802a.tar.gz linux-63ecae7e439f766e88c91da56955bca4db06802a.tar.bz2 linux-63ecae7e439f766e88c91da56955bca4db06802a.zip |
ceph: stop using current_kernel_time()
ceph_mdsc_create_request() is one of the last callers of the
deprecated current_kernel_time() as well as timespec_trunc().
This changes it to use the timespec64 based interfaces instead,
though we still need to convert the result until we are ready to
change over req->r_stamp.
The output of the two functions, ktime_get_coarse_real_ts64() and
current_kernel_time() is the same coarse-granular timestamp,
the only difference here is that ktime_get_coarse_real_ts64()
doesn't overflow in 2038.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/mds_client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index f1590256d2e6..d2679dce7332 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1779,6 +1779,7 @@ struct ceph_mds_request * ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) { struct ceph_mds_request *req = kzalloc(sizeof(*req), GFP_NOFS); + struct timespec64 ts; if (!req) return ERR_PTR(-ENOMEM); @@ -1797,7 +1798,9 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) init_completion(&req->r_safe_completion); INIT_LIST_HEAD(&req->r_unsafe_item); - req->r_stamp = timespec_trunc(current_kernel_time(), mdsc->fsc->sb->s_time_gran); + ktime_get_coarse_real_ts64(&ts); + req->r_stamp = timespec64_to_timespec(timespec64_trunc(ts, + mdsc->fsc->sb->s_time_gran)); req->r_op = op; req->r_direct_mode = mode; |