diff options
author | Alex Elder <elder@inktank.com> | 2012-06-04 15:43:32 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-06-06 10:23:54 -0400 |
commit | 1c20f2d26795803fc4f5155fe4fca5717a5944b6 (patch) | |
tree | 9939afc993d7ab8244518777b742f36dd3e038da /net/ceph/mon_client.c | |
parent | 1bfd89f4e6e1adc6a782d94aa5d4c53be1e404d7 (diff) |
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>
Diffstat (limited to 'net/ceph/mon_client.c')
-rw-r--r-- | net/ceph/mon_client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index ab6b24a5169e..8462ccec6333 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -442,6 +442,7 @@ static struct ceph_msg *get_generic_reply(struct ceph_connection *con, | |||
442 | m = NULL; | 442 | m = NULL; |
443 | } else { | 443 | } else { |
444 | dout("get_generic_reply %lld got %p\n", tid, req->reply); | 444 | dout("get_generic_reply %lld got %p\n", tid, req->reply); |
445 | *skip = 0; | ||
445 | m = ceph_msg_get(req->reply); | 446 | m = ceph_msg_get(req->reply); |
446 | /* | 447 | /* |
447 | * we don't need to track the connection reading into | 448 | * 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, | |||
982 | case CEPH_MSG_MDS_MAP: | 983 | case CEPH_MSG_MDS_MAP: |
983 | case CEPH_MSG_OSD_MAP: | 984 | case CEPH_MSG_OSD_MAP: |
984 | m = ceph_msg_new(type, front_len, GFP_NOFS, false); | 985 | m = ceph_msg_new(type, front_len, GFP_NOFS, false); |
986 | if (!m) | ||
987 | return NULL; /* ENOMEM--return skip == 0 */ | ||
985 | break; | 988 | break; |
986 | } | 989 | } |
987 | 990 | ||