mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
libceph: tweak ceph_alloc_msg()
The function ceph_alloc_msg() is only used to allocate a message that will be assigned to a connection's in_msg pointer. Rename the function so this implied usage is more clear. In addition, make that assignment inside the function (again, since that's precisely what it's intended to be used for). This allows us to return what is now provided via the passed-in address of a "skip" variable. The return type is now Boolean to be explicit that there are only two possible outcomes. Make sure the result of an ->alloc_msg method call always sets the value of *skip properly. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
1bfd89f4e6
commit
1c20f2d267
3 changed files with 38 additions and 27 deletions
|
@ -442,6 +442,7 @@ static struct ceph_msg *get_generic_reply(struct ceph_connection *con,
|
|||
m = NULL;
|
||||
} else {
|
||||
dout("get_generic_reply %lld got %p\n", tid, req->reply);
|
||||
*skip = 0;
|
||||
m = ceph_msg_get(req->reply);
|
||||
/*
|
||||
* we don't need to track the connection reading into
|
||||
|
@ -982,6 +983,8 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
|
|||
case CEPH_MSG_MDS_MAP:
|
||||
case CEPH_MSG_OSD_MAP:
|
||||
m = ceph_msg_new(type, front_len, GFP_NOFS, false);
|
||||
if (!m)
|
||||
return NULL; /* ENOMEM--return skip == 0 */
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue