diff options
author | Sage Weil <sage@inktank.com> | 2013-03-25 13:26:14 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:14 -0400 |
commit | 27859f9773e4a0b2042435b13400ee2c891a61f4 (patch) | |
tree | 28b8e7133959c88f4de89cc98eee2016874b1ca6 /net/ceph/mon_client.c | |
parent | 0bed9b5c523d577378b6f83eab5835fe30c27208 (diff) |
libceph: wrap auth ops in wrapper functions
Use wrapper functions that check whether the auth op exists so that callers
do not need a bunch of conditional checks. Simplifies the external
interface.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net/ceph/mon_client.c')
-rw-r--r-- | net/ceph/mon_client.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index aef5b1062bee..1fe25cd29d0e 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -737,7 +737,7 @@ static void delayed_work(struct work_struct *work) | |||
737 | 737 | ||
738 | __validate_auth(monc); | 738 | __validate_auth(monc); |
739 | 739 | ||
740 | if (monc->auth->ops->is_authenticated(monc->auth)) | 740 | if (ceph_auth_is_authenticated(monc->auth)) |
741 | __send_subscribe(monc); | 741 | __send_subscribe(monc); |
742 | } | 742 | } |
743 | __schedule_delayed(monc); | 743 | __schedule_delayed(monc); |
@@ -892,8 +892,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc, | |||
892 | 892 | ||
893 | mutex_lock(&monc->mutex); | 893 | mutex_lock(&monc->mutex); |
894 | had_debugfs_info = have_debugfs_info(monc); | 894 | had_debugfs_info = have_debugfs_info(monc); |
895 | if (monc->auth->ops) | 895 | was_auth = ceph_auth_is_authenticated(monc->auth); |
896 | was_auth = monc->auth->ops->is_authenticated(monc->auth); | ||
897 | monc->pending_auth = 0; | 896 | monc->pending_auth = 0; |
898 | ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base, | 897 | ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base, |
899 | msg->front.iov_len, | 898 | msg->front.iov_len, |
@@ -904,7 +903,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc, | |||
904 | wake_up_all(&monc->client->auth_wq); | 903 | wake_up_all(&monc->client->auth_wq); |
905 | } else if (ret > 0) { | 904 | } else if (ret > 0) { |
906 | __send_prepared_auth_request(monc, ret); | 905 | __send_prepared_auth_request(monc, ret); |
907 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { | 906 | } else if (!was_auth && ceph_auth_is_authenticated(monc->auth)) { |
908 | dout("authenticated, starting session\n"); | 907 | dout("authenticated, starting session\n"); |
909 | 908 | ||
910 | monc->client->msgr.inst.name.type = CEPH_ENTITY_TYPE_CLIENT; | 909 | monc->client->msgr.inst.name.type = CEPH_ENTITY_TYPE_CLIENT; |