Commit 59699a5a authored by Max Kellermann's avatar Max Kellermann Committed by Ilya Dryomov
Browse files

libceph: make ceph_con_get_out_msg() return the message pointer



The caller in messenger_v1.c loads it anyway, so let's keep the
pointer in the register instead of reloading it from memory.  This
eliminates a tiny bit of unnecessary overhead.

Signed-off-by: default avatarMax Kellermann <max.kellermann@ionos.com>
Reviewed-by: default avatarViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent fbeafe78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ void ceph_addr_set_port(struct ceph_entity_addr *addr, int p);
void ceph_con_process_message(struct ceph_connection *con);
int ceph_con_in_msg_alloc(struct ceph_connection *con,
			  struct ceph_msg_header *hdr, int *skip);
void ceph_con_get_out_msg(struct ceph_connection *con);
struct ceph_msg *ceph_con_get_out_msg(struct ceph_connection *con);

/* messenger_v1.c */
int ceph_con_v1_try_read(struct ceph_connection *con);
+2 −2
Original line number Diff line number Diff line
@@ -2110,7 +2110,7 @@ int ceph_con_in_msg_alloc(struct ceph_connection *con,
	return ret;
}

void ceph_con_get_out_msg(struct ceph_connection *con)
struct ceph_msg *ceph_con_get_out_msg(struct ceph_connection *con)
{
	struct ceph_msg *msg;

@@ -2141,7 +2141,7 @@ void ceph_con_get_out_msg(struct ceph_connection *con)
	 * message or in case of a fault.
	 */
	WARN_ON(con->out_msg);
	con->out_msg = ceph_msg_get(msg);
	return con->out_msg = ceph_msg_get(msg);
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -210,8 +210,7 @@ static void prepare_write_message(struct ceph_connection *con)
			&con->v1.out_temp_ack);
	}

	ceph_con_get_out_msg(con);
	m = con->out_msg;
	m = ceph_con_get_out_msg(con);

	dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n",
	     m, con->out_seq, le16_to_cpu(m->hdr.type),