aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-01-15 07:20:01 -0500
committerIlya Dryomov <idryomov@gmail.com>2016-01-21 13:36:09 -0500
commitf6cdb2928df87c2277ec691101e5843db6cb96ea (patch)
treea7f3777a1a5cbcab35fcbcf3474ce9b32e881b5f
parent187d131dd983fb1ab1c5d0d9ee98ab6511f252cd (diff)
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: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
-rw-r--r--net/ceph/auth_x.c6
-rw-r--r--net/ceph/auth_x.h1
2 files changed, 2 insertions, 5 deletions
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 05e9fc21d460..9e43a315e662 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -152,7 +152,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
152 void *ticket_buf = NULL; 152 void *ticket_buf = NULL;
153 void *tp, *tpend; 153 void *tp, *tpend;
154 void **ptp; 154 void **ptp;
155 struct ceph_timespec new_validity;
156 struct ceph_crypto_key new_session_key; 155 struct ceph_crypto_key new_session_key;
157 struct ceph_buffer *new_ticket_blob; 156 struct ceph_buffer *new_ticket_blob;
158 unsigned long new_expires, new_renew_after; 157 unsigned long new_expires, new_renew_after;
@@ -193,8 +192,8 @@ static int process_one_ticket(struct ceph_auth_client *ac,
193 if (ret) 192 if (ret)
194 goto out; 193 goto out;
195 194
196 ceph_decode_copy(&dp, &new_validity, sizeof(new_validity)); 195 ceph_decode_timespec(&validity, dp);
197 ceph_decode_timespec(&validity, &new_validity); 196 dp += sizeof(struct ceph_timespec);
198 new_expires = get_seconds() + validity.tv_sec; 197 new_expires = get_seconds() + validity.tv_sec;
199 new_renew_after = new_expires - (validity.tv_sec / 4); 198 new_renew_after = new_expires - (validity.tv_sec / 4);
200 dout(" expires=%lu renew_after=%lu\n", new_expires, 199 dout(" expires=%lu renew_after=%lu\n", new_expires,
@@ -233,7 +232,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
233 ceph_buffer_put(th->ticket_blob); 232 ceph_buffer_put(th->ticket_blob);
234 th->session_key = new_session_key; 233 th->session_key = new_session_key;
235 th->ticket_blob = new_ticket_blob; 234 th->ticket_blob = new_ticket_blob;
236 th->validity = new_validity;
237 th->secret_id = new_secret_id; 235 th->secret_id = new_secret_id;
238 th->expires = new_expires; 236 th->expires = new_expires;
239 th->renew_after = new_renew_after; 237 th->renew_after = new_renew_after;
diff --git a/net/ceph/auth_x.h b/net/ceph/auth_x.h
index 5334b9b159c5..40b1a3cf7397 100644
--- a/net/ceph/auth_x.h
+++ b/net/ceph/auth_x.h
@@ -16,7 +16,6 @@ struct ceph_x_ticket_handler {
16 unsigned int service; 16 unsigned int service;
17 17
18 struct ceph_crypto_key session_key; 18 struct ceph_crypto_key session_key;
19 struct ceph_timespec validity;
20 bool have_key; 19 bool have_key;
21 20
22 u64 secret_id; 21 u64 secret_id;