mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 15:49:56 +00:00
libceph: factor out __prepare_write_connect()
Will be used for sending ceph_msg_connect with an updated authorizer, after the server challenges the initial authorizer. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
262614c429
commit
c0f56b483a
@ -1469,6 +1469,17 @@ static void prepare_write_banner(struct ceph_connection *con)
|
|||||||
con_flag_set(con, CON_FLAG_WRITE_PENDING);
|
con_flag_set(con, CON_FLAG_WRITE_PENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __prepare_write_connect(struct ceph_connection *con)
|
||||||
|
{
|
||||||
|
con_out_kvec_add(con, sizeof(con->out_connect), &con->out_connect);
|
||||||
|
if (con->auth)
|
||||||
|
con_out_kvec_add(con, con->auth->authorizer_buf_len,
|
||||||
|
con->auth->authorizer_buf);
|
||||||
|
|
||||||
|
con->out_more = 0;
|
||||||
|
con_flag_set(con, CON_FLAG_WRITE_PENDING);
|
||||||
|
}
|
||||||
|
|
||||||
static int prepare_write_connect(struct ceph_connection *con)
|
static int prepare_write_connect(struct ceph_connection *con)
|
||||||
{
|
{
|
||||||
unsigned int global_seq = get_global_seq(con->msgr, 0);
|
unsigned int global_seq = get_global_seq(con->msgr, 0);
|
||||||
@ -1504,15 +1515,7 @@ static int prepare_write_connect(struct ceph_connection *con)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
con_out_kvec_add(con, sizeof (con->out_connect),
|
__prepare_write_connect(con);
|
||||||
&con->out_connect);
|
|
||||||
if (con->auth)
|
|
||||||
con_out_kvec_add(con, con->auth->authorizer_buf_len,
|
|
||||||
con->auth->authorizer_buf);
|
|
||||||
|
|
||||||
con->out_more = 0;
|
|
||||||
con_flag_set(con, CON_FLAG_WRITE_PENDING);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user