aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-11 15:57:13 -0400
committerSage Weil <sage@inktank.com>2012-07-06 00:14:15 -0400
commitdf6ad1f97342ebc4270128222e896541405eecdb (patch)
treef2a9edf494d5b2da530260dcf8a591b7a562a15f /net
parentfd154f3c75465abd83b7a395033e3755908a1e6e (diff)
libceph: move init_bio_*() functions up
Move init_bio_iter() and iter_bio_next() up in their source file so the'll be defined before they're needed. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 5354d59ba8b9..7b5ff4545bf3 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -565,6 +565,31 @@ static void con_out_kvec_add(struct ceph_connection *con,
565 con->out_kvec_bytes += size; 565 con->out_kvec_bytes += size;
566} 566}
567 567
568#ifdef CONFIG_BLOCK
569static void init_bio_iter(struct bio *bio, struct bio **iter, int *seg)
570{
571 if (!bio) {
572 *iter = NULL;
573 *seg = 0;
574 return;
575 }
576 *iter = bio;
577 *seg = bio->bi_idx;
578}
579
580static void iter_bio_next(struct bio **bio_iter, int *seg)
581{
582 if (*bio_iter == NULL)
583 return;
584
585 BUG_ON(*seg >= (*bio_iter)->bi_vcnt);
586
587 (*seg)++;
588 if (*seg == (*bio_iter)->bi_vcnt)
589 init_bio_iter((*bio_iter)->bi_next, bio_iter, seg);
590}
591#endif
592
568static void prepare_write_message_data(struct ceph_connection *con) 593static void prepare_write_message_data(struct ceph_connection *con)
569{ 594{
570 struct ceph_msg *msg = con->out_msg; 595 struct ceph_msg *msg = con->out_msg;
@@ -868,31 +893,6 @@ out:
868 return ret; /* done! */ 893 return ret; /* done! */
869} 894}
870 895
871#ifdef CONFIG_BLOCK
872static void init_bio_iter(struct bio *bio, struct bio **iter, int *seg)
873{
874 if (!bio) {
875 *iter = NULL;
876 *seg = 0;
877 return;
878 }
879 *iter = bio;
880 *seg = bio->bi_idx;
881}
882
883static void iter_bio_next(struct bio **bio_iter, int *seg)
884{
885 if (*bio_iter == NULL)
886 return;
887
888 BUG_ON(*seg >= (*bio_iter)->bi_vcnt);
889
890 (*seg)++;
891 if (*seg == (*bio_iter)->bi_vcnt)
892 init_bio_iter((*bio_iter)->bi_next, bio_iter, seg);
893}
894#endif
895
896static void out_msg_pos_next(struct ceph_connection *con, struct page *page, 896static void out_msg_pos_next(struct ceph_connection *con, struct page *page,
897 size_t len, size_t sent, bool in_trail) 897 size_t len, size_t sent, bool in_trail)
898{ 898{