aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-12 00:34:23 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:26 -0400
commit6518be47f910f62a98cb6044dbb457af55241f95 (patch)
tree6d1244367ec16ee602b44573a7b84646d416214a
parent463207aa40cf2cadcae84866b3f85ccaa7022ee8 (diff)
libceph: kill ceph message bio_iter, bio_seg
The bio_iter and bio_seg fields in a message are no longer used, we use the cursor instead. So get rid of them and the functions that operate on them them. This is related to: http://tracker.ceph.com/issues/4428 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--include/linux/ceph/messenger.h6
-rw-r--r--net/ceph/messenger.c31
2 files changed, 1 insertions, 36 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 459e55280bf8..252e01b7f7de 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -121,11 +121,7 @@ struct ceph_msg_data {
121 enum ceph_msg_data_type type; 121 enum ceph_msg_data_type type;
122 union { 122 union {
123#ifdef CONFIG_BLOCK 123#ifdef CONFIG_BLOCK
124 struct { 124 struct bio *bio;
125 struct bio *bio_iter; /* iterator */
126 struct bio *bio;
127 unsigned int bio_seg; /* current seg in bio */
128 };
129#endif /* CONFIG_BLOCK */ 125#endif /* CONFIG_BLOCK */
130 struct { 126 struct {
131 struct page **pages; /* NOT OWNER. */ 127 struct page **pages; /* NOT OWNER. */
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index c795d46d7d4b..b634d2098777 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -716,29 +716,6 @@ static void con_out_kvec_add(struct ceph_connection *con,
716} 716}
717 717
718#ifdef CONFIG_BLOCK 718#ifdef CONFIG_BLOCK
719static void init_bio_iter(struct bio *bio, struct bio **bio_iter,
720 unsigned int *bio_seg)
721{
722 if (!bio) {
723 *bio_iter = NULL;
724 *bio_seg = 0;
725 return;
726 }
727 *bio_iter = bio;
728 *bio_seg = (unsigned int) bio->bi_idx;
729}
730
731static void iter_bio_next(struct bio **bio_iter, unsigned int *seg)
732{
733 if (*bio_iter == NULL)
734 return;
735
736 BUG_ON(*seg >= (*bio_iter)->bi_vcnt);
737
738 (*seg)++;
739 if (*seg == (*bio_iter)->bi_vcnt)
740 init_bio_iter((*bio_iter)->bi_next, bio_iter, seg);
741}
742 719
743/* 720/*
744 * For a bio data item, a piece is whatever remains of the next 721 * For a bio data item, a piece is whatever remains of the next
@@ -1112,10 +1089,6 @@ static void prepare_message_data(struct ceph_msg *msg,
1112 msg_pos->page_pos = msg->p.alignment; 1089 msg_pos->page_pos = msg->p.alignment;
1113 else 1090 else
1114 msg_pos->page_pos = 0; 1091 msg_pos->page_pos = 0;
1115#ifdef CONFIG_BLOCK
1116 if (ceph_msg_has_bio(msg))
1117 init_bio_iter(msg->b.bio, &msg->b.bio_iter, &msg->b.bio_seg);
1118#endif
1119 msg_pos->data_pos = 0; 1092 msg_pos->data_pos = 0;
1120 1093
1121 /* Initialize data cursors */ 1094 /* Initialize data cursors */
@@ -1478,10 +1451,6 @@ static void in_msg_pos_next(struct ceph_connection *con, size_t len,
1478 BUG_ON(received != len); 1451 BUG_ON(received != len);
1479 msg_pos->page_pos = 0; 1452 msg_pos->page_pos = 0;
1480 msg_pos->page++; 1453 msg_pos->page++;
1481#ifdef CONFIG_BLOCK
1482 if (msg->b.bio)
1483 iter_bio_next(&msg->b.bio_iter, &msg->b.bio_seg);
1484#endif /* CONFIG_BLOCK */
1485} 1454}
1486 1455
1487static u32 ceph_crc32c_page(u32 crc, struct page *page, 1456static u32 ceph_crc32c_page(u32 crc, struct page *page,