This is a note to let you know that I've just added the patch titled

    ceph: messenger: reduce args to create_authorizer

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     0019-ceph-messenger-reduce-args-to-create_authorizer.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 1ded78d42d2d4fa895df865f43a1cdbd0a94f090 Mon Sep 17 00:00:00 2001
From: Alex Elder <[email protected]>
Date: Wed, 16 May 2012 15:16:39 -0500
Subject: ceph: messenger: reduce args to create_authorizer

From: Alex Elder <[email protected]>

(cherry picked from commit 74f1869f76d043bad12ec03b4d5f04a8c3d1f157)

Make use of the new ceph_auth_handshake structure in order to reduce
the number of arguments passed to the create_authorizor method in
ceph_auth_client_ops.  Use a local variable of that type as a
shorthand in the get_authorizer method definitions.

Signed-off-by: Alex Elder <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 fs/ceph/mds_client.c      |   27 ++++++++++++---------------
 include/linux/ceph/auth.h |    4 +---
 net/ceph/auth_none.c      |   15 +++++++--------
 net/ceph/auth_x.c         |   15 +++++++--------
 net/ceph/osd_client.c     |   26 +++++++++++---------------
 5 files changed, 38 insertions(+), 49 deletions(-)

--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -3402,31 +3402,28 @@ static int get_authorizer(struct ceph_co
        struct ceph_mds_session *s = con->private;
        struct ceph_mds_client *mdsc = s->s_mdsc;
        struct ceph_auth_client *ac = mdsc->fsc->client->monc.auth;
+       struct ceph_auth_handshake *auth = &s->s_auth;
        int ret = 0;
 
-       if (force_new && s->s_auth.authorizer) {
-               ac->ops->destroy_authorizer(ac, s->s_auth.authorizer);
-               s->s_auth.authorizer = NULL;
+       if (force_new && auth->authorizer) {
+               ac->ops->destroy_authorizer(ac, auth->authorizer);
+               auth->authorizer = NULL;
        }
-       if (s->s_auth.authorizer == NULL) {
+       if (auth->authorizer == NULL) {
                if (ac->ops->create_authorizer) {
-                       ret = ac->ops->create_authorizer(
-                               ac, CEPH_ENTITY_TYPE_MDS,
-                               &s->s_auth.authorizer,
-                               &s->s_auth.authorizer_buf,
-                               &s->s_auth.authorizer_buf_len,
-                               &s->s_auth.authorizer_reply_buf,
-                               &s->s_auth.authorizer_reply_buf_len);
+                       ret = ac->ops->create_authorizer(ac,
+                                               CEPH_ENTITY_TYPE_MDS, auth);
                        if (ret)
                                return ret;
                }
        }
 
        *proto = ac->protocol;
-       *buf = s->s_auth.authorizer_buf;
-       *len = s->s_auth.authorizer_buf_len;
-       *reply_buf = s->s_auth.authorizer_reply_buf;
-       *reply_len = s->s_auth.authorizer_reply_buf_len;
+       *buf = auth->authorizer_buf;
+       *len = auth->authorizer_buf_len;
+       *reply_buf = auth->authorizer_reply_buf;
+       *reply_len = auth->authorizer_reply_buf_len;
+
        return 0;
 }
 
--- a/include/linux/ceph/auth.h
+++ b/include/linux/ceph/auth.h
@@ -51,9 +51,7 @@ struct ceph_auth_client_ops {
         * the response to authenticate the service.
         */
        int (*create_authorizer)(struct ceph_auth_client *ac, int peer_type,
-                                struct ceph_authorizer **a,
-                                void **buf, size_t *len,
-                                void **reply_buf, size_t *reply_len);
+                                struct ceph_auth_handshake *auth);
        int (*verify_authorizer_reply)(struct ceph_auth_client *ac,
                                       struct ceph_authorizer *a, size_t len);
        void (*destroy_authorizer)(struct ceph_auth_client *ac,
--- a/net/ceph/auth_none.c
+++ b/net/ceph/auth_none.c
@@ -59,9 +59,7 @@ static int handle_reply(struct ceph_auth
  */
 static int ceph_auth_none_create_authorizer(
        struct ceph_auth_client *ac, int peer_type,
-       struct ceph_authorizer **a,
-       void **buf, size_t *len,
-       void **reply_buf, size_t *reply_len)
+       struct ceph_auth_handshake *auth)
 {
        struct ceph_auth_none_info *ai = ac->private;
        struct ceph_none_authorizer *au = &ai->au;
@@ -82,11 +80,12 @@ static int ceph_auth_none_create_authori
                dout("built authorizer len %d\n", au->buf_len);
        }
 
-       *a = (struct ceph_authorizer *)au;
-       *buf = au->buf;
-       *len = au->buf_len;
-       *reply_buf = au->reply_buf;
-       *reply_len = sizeof(au->reply_buf);
+       auth->authorizer = (struct ceph_authorizer *) au;
+       auth->authorizer_buf = au->buf;
+       auth->authorizer_buf_len = au->buf_len;
+       auth->authorizer_reply_buf = au->reply_buf;
+       auth->authorizer_reply_buf_len = sizeof (au->reply_buf);
+
        return 0;
 
 bad2:
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -526,9 +526,7 @@ static int ceph_x_handle_reply(struct ce
 
 static int ceph_x_create_authorizer(
        struct ceph_auth_client *ac, int peer_type,
-       struct ceph_authorizer **a,
-       void **buf, size_t *len,
-       void **reply_buf, size_t *reply_len)
+       struct ceph_auth_handshake *auth)
 {
        struct ceph_x_authorizer *au;
        struct ceph_x_ticket_handler *th;
@@ -548,11 +546,12 @@ static int ceph_x_create_authorizer(
                return ret;
        }
 
-       *a = (struct ceph_authorizer *)au;
-       *buf = au->buf->vec.iov_base;
-       *len = au->buf->vec.iov_len;
-       *reply_buf = au->reply_buf;
-       *reply_len = sizeof(au->reply_buf);
+       auth->authorizer = (struct ceph_authorizer *) au;
+       auth->authorizer_buf = au->buf->vec.iov_base;
+       auth->authorizer_buf_len = au->buf->vec.iov_len;
+       auth->authorizer_reply_buf = au->reply_buf;
+       auth->authorizer_reply_buf_len = sizeof (au->reply_buf);
+
        return 0;
 }
 
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -2115,29 +2115,25 @@ static int get_authorizer(struct ceph_co
        struct ceph_osd *o = con->private;
        struct ceph_osd_client *osdc = o->o_osdc;
        struct ceph_auth_client *ac = osdc->client->monc.auth;
+       struct ceph_auth_handshake *auth = &o->o_auth;
        int ret = 0;
 
-       if (force_new && o->o_auth.authorizer) {
-               ac->ops->destroy_authorizer(ac, o->o_auth.authorizer);
-               o->o_auth.authorizer = NULL;
+       if (force_new && auth->authorizer) {
+               ac->ops->destroy_authorizer(ac, auth->authorizer);
+               auth->authorizer = NULL;
        }
-       if (o->o_auth.authorizer == NULL) {
-               ret = ac->ops->create_authorizer(
-                       ac, CEPH_ENTITY_TYPE_OSD,
-                       &o->o_auth.authorizer,
-                       &o->o_auth.authorizer_buf,
-                       &o->o_auth.authorizer_buf_len,
-                       &o->o_auth.authorizer_reply_buf,
-                       &o->o_auth.authorizer_reply_buf_len);
+       if (auth->authorizer == NULL) {
+               ret = ac->ops->create_authorizer(ac, CEPH_ENTITY_TYPE_OSD, 
auth);
                if (ret)
                        return ret;
        }
 
        *proto = ac->protocol;
-       *buf = o->o_auth.authorizer_buf;
-       *len = o->o_auth.authorizer_buf_len;
-       *reply_buf = o->o_auth.authorizer_reply_buf;
-       *reply_len = o->o_auth.authorizer_reply_buf_len;
+       *buf = auth->authorizer_buf;
+       *len = auth->authorizer_buf_len;
+       *reply_buf = auth->authorizer_reply_buf;
+       *reply_len = auth->authorizer_reply_buf_len;
+
        return 0;
 }
 


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/0005-crush-fix-memory-leak-when-destroying-tree-buckets.patch
queue-3.4/0002-crush-adjust-local-retry-threshold.patch
queue-3.4/0018-ceph-define-ceph_auth_handshake-type.patch
queue-3.4/0011-ceph-messenger-reset-connection-kvec-caller.patch
queue-3.4/0019-ceph-messenger-reduce-args-to-create_authorizer.patch
queue-3.4/0015-ceph-messenger-check-prepare_write_connect-result.patch
queue-3.4/0003-crush-be-more-tolerant-of-nonsensical-crush-maps.patch
queue-3.4/0014-ceph-don-t-set-WRITE_PENDING-too-early.patch
queue-3.4/0016-ceph-messenger-rework-prepare_connect_authorizer.patch
queue-3.4/0013-ceph-drop-msgr-argument-from-prepare_write_connect.patch
queue-3.4/0009-ceph-messenger-change-read_partial-to-take-end-arg.patch
queue-3.4/0017-ceph-messenger-check-return-from-get_authorizer.patch
queue-3.4/0001-crush-clean-up-types-const-ness.patch
queue-3.4/0008-ceph-messenger-update-to-in-read_partial-caller.patch
queue-3.4/0007-ceph-messenger-use-read_partial-in-read_partial_mess.patch
queue-3.4/0010-libceph-don-t-reset-kvec-in-prepare_write_banner.patch
queue-3.4/0012-ceph-messenger-send-banner-in-process_connect.patch
queue-3.4/0004-crush-fix-tree-node-weight-lookup.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to