diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-03-22 12:20:45 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:44:52 -0500 |
commit | a02d124091ac7178c24a1318e5dcc4ae7fe6c8e1 (patch) | |
tree | 1e2e6b699491edaac9b628ef64e7f484fe5a363f /drivers/block/drbd/drbd_receiver.c | |
parent | 058820cdd7e6c96e6656a990af2188059113735e (diff) |
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, | |||
3600 | return 1; | 3600 | return 1; |
3601 | } | 3601 | } |
3602 | 3602 | ||
3603 | static enum drbd_bitmap_code dcbp_get_code(struct p_compressed_bm *p) | ||
3604 | { | ||
3605 | return (enum drbd_bitmap_code)(p->encoding & 0x0f); | ||
3606 | } | ||
3607 | |||
3608 | static int dcbp_get_start(struct p_compressed_bm *p) | ||
3609 | { | ||
3610 | return (p->encoding & 0x80) != 0; | ||
3611 | } | ||
3612 | |||
3613 | static int dcbp_get_pad_bits(struct p_compressed_bm *p) | ||
3614 | { | ||
3615 | return (p->encoding >> 4) & 0x7; | ||
3616 | } | ||
3617 | |||
3603 | /** | 3618 | /** |
3604 | * recv_bm_rle_bits | 3619 | * recv_bm_rle_bits |
3605 | * | 3620 | * |
@@ -3618,11 +3633,11 @@ recv_bm_rle_bits(struct drbd_conf *mdev, | |||
3618 | u64 tmp; | 3633 | u64 tmp; |
3619 | unsigned long s = c->bit_offset; | 3634 | unsigned long s = c->bit_offset; |
3620 | unsigned long e; | 3635 | unsigned long e; |
3621 | int toggle = DCBP_get_start(p); | 3636 | int toggle = dcbp_get_start(p); |
3622 | int have; | 3637 | int have; |
3623 | int bits; | 3638 | int bits; |
3624 | 3639 | ||
3625 | bitstream_init(&bs, p->code, len, DCBP_get_pad_bits(p)); | 3640 | bitstream_init(&bs, p->code, len, dcbp_get_pad_bits(p)); |
3626 | 3641 | ||
3627 | bits = bitstream_get_bits(&bs, &look_ahead, 64); | 3642 | bits = bitstream_get_bits(&bs, &look_ahead, 64); |
3628 | if (bits < 0) | 3643 | if (bits < 0) |
@@ -3677,7 +3692,7 @@ decode_bitmap_c(struct drbd_conf *mdev, | |||
3677 | struct bm_xfer_ctx *c, | 3692 | struct bm_xfer_ctx *c, |
3678 | unsigned int len) | 3693 | unsigned int len) |
3679 | { | 3694 | { |
3680 | if (DCBP_get_code(p) == RLE_VLI_Bits) | 3695 | if (dcbp_get_code(p) == RLE_VLI_Bits) |
3681 | return recv_bm_rle_bits(mdev, p, c, len); | 3696 | return recv_bm_rle_bits(mdev, p, c, len); |
3682 | 3697 | ||
3683 | /* other variants had been implemented for evaluation, | 3698 | /* other variants had been implemented for evaluation, |