diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-03-16 17:22:39 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 16:44:44 +0100 |
commit | 8172f3e9bf9bc239caec96382573b8d9b01baa09 (patch) | |
tree | fa7da0ccdb807e1f6785a411b23121e0884a0489 /drivers/block/drbd | |
parent | e2b3032b902f600980dab9516d12e955c68aa1f4 (diff) | |
download | blackbird-op-linux-8172f3e9bf9bc239caec96382573b8d9b01baa09.tar.gz blackbird-op-linux-8172f3e9bf9bc239caec96382573b8d9b01baa09.zip |
drbd: decode_header(): Return 0 upon success and an error code otherwise
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 03c21e594630..5902d242dca5 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -948,7 +948,7 @@ out_release_sockets: return -1; } -static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct packet_info *pi) +static int decode_header(struct drbd_tconn *tconn, struct p_header *h, struct packet_info *pi) { if (h->h80.magic == cpu_to_be32(DRBD_MAGIC)) { pi->cmd = be16_to_cpu(h->h80.command); @@ -963,9 +963,9 @@ static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct p be32_to_cpu(h->h80.magic), be16_to_cpu(h->h80.command), be16_to_cpu(h->h80.length)); - return false; + return -EINVAL; } - return true; + return 0; } static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi) @@ -980,7 +980,7 @@ static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi) return false; } - r = decode_header(tconn, h, pi); + r = !decode_header(tconn, h, pi); tconn->last_received = jiffies; return r; @@ -4845,7 +4845,7 @@ int drbd_asender(struct drbd_thread *thi) } if (received == expect && cmd == NULL) { - if (!decode_header(tconn, h, &pi)) + if (decode_header(tconn, h, &pi)) goto reconnect; cmd = &asender_tbl[pi.cmd]; if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd) { |