Commit f6cdb292 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: kill off ceph_x_ticket_handler::validity

With it gone, no need to preserve ceph_timespec in process_one_ticket()
either.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarSage Weil <sage@redhat.com>
parent 187d131d
...@@ -152,7 +152,6 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -152,7 +152,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
void *ticket_buf = NULL; void *ticket_buf = NULL;
void *tp, *tpend; void *tp, *tpend;
void **ptp; void **ptp;
struct ceph_timespec new_validity;
struct ceph_crypto_key new_session_key; struct ceph_crypto_key new_session_key;
struct ceph_buffer *new_ticket_blob; struct ceph_buffer *new_ticket_blob;
unsigned long new_expires, new_renew_after; unsigned long new_expires, new_renew_after;
...@@ -193,8 +192,8 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -193,8 +192,8 @@ static int process_one_ticket(struct ceph_auth_client *ac,
if (ret) if (ret)
goto out; goto out;
ceph_decode_copy(&dp, &new_validity, sizeof(new_validity)); ceph_decode_timespec(&validity, dp);
ceph_decode_timespec(&validity, &new_validity); dp += sizeof(struct ceph_timespec);
new_expires = get_seconds() + validity.tv_sec; new_expires = get_seconds() + validity.tv_sec;
new_renew_after = new_expires - (validity.tv_sec / 4); new_renew_after = new_expires - (validity.tv_sec / 4);
dout(" expires=%lu renew_after=%lu\n", new_expires, dout(" expires=%lu renew_after=%lu\n", new_expires,
...@@ -233,7 +232,6 @@ static int process_one_ticket(struct ceph_auth_client *ac, ...@@ -233,7 +232,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
ceph_buffer_put(th->ticket_blob); ceph_buffer_put(th->ticket_blob);
th->session_key = new_session_key; th->session_key = new_session_key;
th->ticket_blob = new_ticket_blob; th->ticket_blob = new_ticket_blob;
th->validity = new_validity;
th->secret_id = new_secret_id; th->secret_id = new_secret_id;
th->expires = new_expires; th->expires = new_expires;
th->renew_after = new_renew_after; th->renew_after = new_renew_after;
......
...@@ -16,7 +16,6 @@ struct ceph_x_ticket_handler { ...@@ -16,7 +16,6 @@ struct ceph_x_ticket_handler {
unsigned int service; unsigned int service;
struct ceph_crypto_key session_key; struct ceph_crypto_key session_key;
struct ceph_timespec validity;
bool have_key; bool have_key;
u64 secret_id; u64 secret_id;
......
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