summaryrefslogtreecommitdiffstats
path: root/fs/ceph/auth_x.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-25 15:39:06 -0700
committerSage Weil <sage@newdream.net>2010-05-29 09:12:39 -0700
commita41359fa355e7b450c610ed8e913d5d75c3c9c3b (patch)
tree6dc6681f4350f0888ddcb55b5a21326069c200b2 /fs/ceph/auth_x.c
parent09c4d6a7d40dd26c1b35674c582382b7ea551368 (diff)
downloadop-kernel-dev-a41359fa355e7b450c610ed8e913d5d75c3c9c3b.zip
op-kernel-dev-a41359fa355e7b450c610ed8e913d5d75c3c9c3b.tar.gz
ceph: renew auth tickets before they expire
We were only requesting renewal after our tickets expire; do so before that. Most of the low-level logic for this was already there; just use it. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/auth_x.c')
-rw-r--r--fs/ceph/auth_x.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ceph/auth_x.c b/fs/ceph/auth_x.c
index 7b20623..83d4d27 100644
--- a/fs/ceph/auth_x.c
+++ b/fs/ceph/auth_x.c
@@ -27,6 +27,17 @@ static int ceph_x_is_authenticated(struct ceph_auth_client *ac)
return (ac->want_keys & xi->have_keys) == ac->want_keys;
}
+static int ceph_x_should_authenticate(struct ceph_auth_client *ac)
+{
+ struct ceph_x_info *xi = ac->private;
+ int need;
+
+ ceph_x_validate_tickets(ac, &need);
+ dout("ceph_x_should_authenticate want=%d need=%d have=%d\n",
+ ac->want_keys, need, xi->have_keys);
+ return need != 0;
+}
+
static int ceph_x_encrypt_buflen(int ilen)
{
return sizeof(struct ceph_x_encrypt_header) + ilen + 16 +
@@ -620,6 +631,7 @@ static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,
static const struct ceph_auth_client_ops ceph_x_ops = {
.name = "x",
.is_authenticated = ceph_x_is_authenticated,
+ .should_authenticate = ceph_x_should_authenticate,
.build_request = ceph_x_build_request,
.handle_reply = ceph_x_handle_reply,
.create_authorizer = ceph_x_create_authorizer,
OpenPOWER on IntegriCloud