diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-03-22 17:20:45 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 16:44:52 +0100 |
commit | a02d124091ac7178c24a1318e5dcc4ae7fe6c8e1 (patch) | |
tree | 1e2e6b699491edaac9b628ef64e7f484fe5a363f /drivers/block/drbd/drbd_receiver.c | |
parent | 058820cdd7e6c96e6656a990af2188059113735e (diff) | |
download | lwn-a02d124091ac7178c24a1318e5dcc4ae7fe6c8e1.tar.gz lwn-a02d124091ac7178c24a1318e5dcc4ae7fe6c8e1.zip |
drbd: Rename the DCBP_* functions to dcbp_* and move them to where they are used
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 27d4a4520641..1fd871bc889e 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3600,6 +3600,21 @@ receive_bitmap_plain(struct drbd_conf *mdev, unsigned int data_size, return 1; } +static enum drbd_bitmap_code dcbp_get_code(struct p_compressed_bm *p) +{ + return (enum drbd_bitmap_code)(p->encoding & 0x0f); +} + +static int dcbp_get_start(struct p_compressed_bm *p) +{ + return (p->encoding & 0x80) != 0; +} + +static int dcbp_get_pad_bits(struct p_compressed_bm *p) +{ + return (p->encoding >> 4) & 0x7; +} + /** * recv_bm_rle_bits * @@ -3618,11 +3633,11 @@ recv_bm_rle_bits(struct drbd_conf *mdev, u64 tmp; unsigned long s = c->bit_offset; unsigned long e; - int toggle = DCBP_get_start(p); + int toggle = dcbp_get_start(p); int have; int bits; - bitstream_init(&bs, p->code, len, DCBP_get_pad_bits(p)); + bitstream_init(&bs, p->code, len, dcbp_get_pad_bits(p)); bits = bitstream_get_bits(&bs, &look_ahead, 64); if (bits < 0) @@ -3677,7 +3692,7 @@ decode_bitmap_c(struct drbd_conf *mdev, struct bm_xfer_ctx *c, unsigned int len) { - if (DCBP_get_code(p) == RLE_VLI_Bits) + if (dcbp_get_code(p) == RLE_VLI_Bits) return recv_bm_rle_bits(mdev, p, c, len); /* other variants had been implemented for evaluation, |