aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 1a22975945da..589b7689d31b 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -812,7 +812,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
812 struct ceph_msg *msg = con->out_msg; 812 struct ceph_msg *msg = con->out_msg;
813 unsigned data_len = le32_to_cpu(msg->hdr.data_len); 813 unsigned data_len = le32_to_cpu(msg->hdr.data_len);
814 size_t len; 814 size_t len;
815 bool do_crc = con->msgr->nocrc; 815 bool do_datacrc = !con->msgr->nocrc;
816 int ret; 816 int ret;
817 int total_max_write; 817 int total_max_write;
818 int in_trail = 0; 818 int in_trail = 0;
@@ -850,17 +850,17 @@ static int write_partial_msg_pages(struct ceph_connection *con)
850 850
851 page = list_first_entry(&msg->trail->head, 851 page = list_first_entry(&msg->trail->head,
852 struct page, lru); 852 struct page, lru);
853 if (do_crc) 853 if (do_datacrc)
854 kaddr = kmap(page); 854 kaddr = kmap(page);
855 max_write = PAGE_SIZE; 855 max_write = PAGE_SIZE;
856 } else if (msg->pages) { 856 } else if (msg->pages) {
857 page = msg->pages[con->out_msg_pos.page]; 857 page = msg->pages[con->out_msg_pos.page];
858 if (do_crc) 858 if (do_datacrc)
859 kaddr = kmap(page); 859 kaddr = kmap(page);
860 } else if (msg->pagelist) { 860 } else if (msg->pagelist) {
861 page = list_first_entry(&msg->pagelist->head, 861 page = list_first_entry(&msg->pagelist->head,
862 struct page, lru); 862 struct page, lru);
863 if (do_crc) 863 if (do_datacrc)
864 kaddr = kmap(page); 864 kaddr = kmap(page);
865#ifdef CONFIG_BLOCK 865#ifdef CONFIG_BLOCK
866 } else if (msg->bio) { 866 } else if (msg->bio) {
@@ -869,19 +869,19 @@ static int write_partial_msg_pages(struct ceph_connection *con)
869 bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg); 869 bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg);
870 page = bv->bv_page; 870 page = bv->bv_page;
871 page_shift = bv->bv_offset; 871 page_shift = bv->bv_offset;
872 if (do_crc) 872 if (do_datacrc)
873 kaddr = kmap(page) + page_shift; 873 kaddr = kmap(page) + page_shift;
874 max_write = bv->bv_len; 874 max_write = bv->bv_len;
875#endif 875#endif
876 } else { 876 } else {
877 page = zero_page; 877 page = zero_page;
878 if (do_crc) 878 if (do_datacrc)
879 kaddr = zero_page_address; 879 kaddr = zero_page_address;
880 } 880 }
881 len = min_t(int, max_write - con->out_msg_pos.page_pos, 881 len = min_t(int, max_write - con->out_msg_pos.page_pos,
882 total_max_write); 882 total_max_write);
883 883
884 if (do_crc && !con->out_msg_pos.did_page_crc) { 884 if (do_datacrc && !con->out_msg_pos.did_page_crc) {
885 u32 crc; 885 u32 crc;
886 void *base = kaddr + con->out_msg_pos.page_pos; 886 void *base = kaddr + con->out_msg_pos.page_pos;
887 u32 tmpcrc = le32_to_cpu(con->out_msg->footer.data_crc); 887 u32 tmpcrc = le32_to_cpu(con->out_msg->footer.data_crc);
@@ -897,7 +897,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
897 MSG_DONTWAIT | MSG_NOSIGNAL | 897 MSG_DONTWAIT | MSG_NOSIGNAL |
898 MSG_MORE); 898 MSG_MORE);
899 899
900 if (do_crc && kaddr != zero_page_address) 900 if (do_datacrc && kaddr != zero_page_address)
901 kunmap(page); 901 kunmap(page);
902 902
903 if (ret == -EAGAIN) 903 if (ret == -EAGAIN)
@@ -927,7 +927,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
927 dout("write_partial_msg_pages %p msg %p done\n", con, msg); 927 dout("write_partial_msg_pages %p msg %p done\n", con, msg);
928 928
929 /* prepare and queue up footer, too */ 929 /* prepare and queue up footer, too */
930 if (!do_crc) 930 if (!do_datacrc)
931 con->out_msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC; 931 con->out_msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC;
932 ceph_con_out_kvec_reset(con); 932 ceph_con_out_kvec_reset(con);
933 prepare_write_message_footer(con); 933 prepare_write_message_footer(con);
@@ -1639,7 +1639,7 @@ static int read_partial_message(struct ceph_connection *con)
1639 int ret; 1639 int ret;
1640 int to, left; 1640 int to, left;
1641 unsigned front_len, middle_len, data_len; 1641 unsigned front_len, middle_len, data_len;
1642 bool do_datacrc = con->msgr->nocrc; 1642 bool do_datacrc = !con->msgr->nocrc;
1643 int skip; 1643 int skip;
1644 u64 seq; 1644 u64 seq;
1645 u32 crc; 1645 u32 crc;