@@ -725,7 +725,7 @@ static void con_out_kvec_add(struct ceph_connection *con,
725725static void ceph_msg_data_bio_cursor_init (struct ceph_msg_data * data ,
726726 size_t length )
727727{
728- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
728+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
729729 struct bio * bio ;
730730
731731 BUG_ON (data -> type != CEPH_MSG_DATA_BIO );
@@ -745,7 +745,7 @@ static struct page *ceph_msg_data_bio_next(struct ceph_msg_data *data,
745745 size_t * page_offset ,
746746 size_t * length )
747747{
748- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
748+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
749749 struct bio * bio ;
750750 struct bio_vec * bio_vec ;
751751 unsigned int index ;
@@ -774,7 +774,7 @@ static struct page *ceph_msg_data_bio_next(struct ceph_msg_data *data,
774774
775775static bool ceph_msg_data_bio_advance (struct ceph_msg_data * data , size_t bytes )
776776{
777- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
777+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
778778 struct bio * bio ;
779779 struct bio_vec * bio_vec ;
780780 unsigned int index ;
@@ -826,7 +826,7 @@ static bool ceph_msg_data_bio_advance(struct ceph_msg_data *data, size_t bytes)
826826static void ceph_msg_data_pages_cursor_init (struct ceph_msg_data * data ,
827827 size_t length )
828828{
829- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
829+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
830830 int page_count ;
831831
832832 BUG_ON (data -> type != CEPH_MSG_DATA_PAGES );
@@ -849,7 +849,7 @@ static struct page *ceph_msg_data_pages_next(struct ceph_msg_data *data,
849849 size_t * page_offset ,
850850 size_t * length )
851851{
852- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
852+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
853853
854854 BUG_ON (data -> type != CEPH_MSG_DATA_PAGES );
855855
@@ -868,7 +868,7 @@ static struct page *ceph_msg_data_pages_next(struct ceph_msg_data *data,
868868static bool ceph_msg_data_pages_advance (struct ceph_msg_data * data ,
869869 size_t bytes )
870870{
871- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
871+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
872872
873873 BUG_ON (data -> type != CEPH_MSG_DATA_PAGES );
874874
@@ -897,7 +897,7 @@ static bool ceph_msg_data_pages_advance(struct ceph_msg_data *data,
897897static void ceph_msg_data_pagelist_cursor_init (struct ceph_msg_data * data ,
898898 size_t length )
899899{
900- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
900+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
901901 struct ceph_pagelist * pagelist ;
902902 struct page * page ;
903903
@@ -923,7 +923,7 @@ static struct page *ceph_msg_data_pagelist_next(struct ceph_msg_data *data,
923923 size_t * page_offset ,
924924 size_t * length )
925925{
926- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
926+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
927927 struct ceph_pagelist * pagelist ;
928928
929929 BUG_ON (data -> type != CEPH_MSG_DATA_PAGELIST );
@@ -941,13 +941,13 @@ static struct page *ceph_msg_data_pagelist_next(struct ceph_msg_data *data,
941941 else
942942 * length = PAGE_SIZE - * page_offset ;
943943
944- return data -> cursor . page ;
944+ return data -> cursor -> page ;
945945}
946946
947947static bool ceph_msg_data_pagelist_advance (struct ceph_msg_data * data ,
948948 size_t bytes )
949949{
950- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
950+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
951951 struct ceph_pagelist * pagelist ;
952952
953953 BUG_ON (data -> type != CEPH_MSG_DATA_PAGELIST );
@@ -1003,7 +1003,7 @@ static void ceph_msg_data_cursor_init(struct ceph_msg_data *data,
10031003 /* BUG(); */
10041004 break ;
10051005 }
1006- data -> cursor . need_crc = true;
1006+ data -> cursor -> need_crc = true;
10071007}
10081008
10091009/*
@@ -1039,7 +1039,7 @@ static struct page *ceph_msg_data_next(struct ceph_msg_data *data,
10391039 BUG_ON (* page_offset + * length > PAGE_SIZE );
10401040 BUG_ON (!* length );
10411041 if (last_piece )
1042- * last_piece = data -> cursor . last_piece ;
1042+ * last_piece = data -> cursor -> last_piece ;
10431043
10441044 return page ;
10451045}
@@ -1050,7 +1050,7 @@ static struct page *ceph_msg_data_next(struct ceph_msg_data *data,
10501050 */
10511051static bool ceph_msg_data_advance (struct ceph_msg_data * data , size_t bytes )
10521052{
1053- struct ceph_msg_data_cursor * cursor = & data -> cursor ;
1053+ struct ceph_msg_data_cursor * cursor = data -> cursor ;
10541054 bool new_piece ;
10551055
10561056 BUG_ON (bytes > cursor -> resid );
@@ -1071,7 +1071,7 @@ static bool ceph_msg_data_advance(struct ceph_msg_data *data, size_t bytes)
10711071 BUG ();
10721072 break ;
10731073 }
1074- data -> cursor . need_crc = new_piece ;
1074+ data -> cursor -> need_crc = new_piece ;
10751075
10761076 return new_piece ;
10771077}
@@ -1404,7 +1404,7 @@ static u32 ceph_crc32c_page(u32 crc, struct page *page,
14041404static int write_partial_message_data (struct ceph_connection * con )
14051405{
14061406 struct ceph_msg * msg = con -> out_msg ;
1407- struct ceph_msg_data_cursor * cursor = & msg -> data -> cursor ;
1407+ struct ceph_msg_data_cursor * cursor = msg -> data -> cursor ;
14081408 bool do_datacrc = !con -> msgr -> nocrc ;
14091409 u32 crc ;
14101410
@@ -2102,7 +2102,7 @@ static int read_partial_message_section(struct ceph_connection *con,
21022102static int read_partial_msg_data (struct ceph_connection * con )
21032103{
21042104 struct ceph_msg * msg = con -> in_msg ;
2105- struct ceph_msg_data_cursor * cursor = & msg -> data -> cursor ;
2105+ struct ceph_msg_data_cursor * cursor = msg -> data -> cursor ;
21062106 const bool do_datacrc = !con -> msgr -> nocrc ;
21072107 struct page * page ;
21082108 size_t page_offset ;
@@ -2991,6 +2991,7 @@ void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages,
29912991
29922992 data = ceph_msg_data_create (CEPH_MSG_DATA_PAGES );
29932993 BUG_ON (!data );
2994+ data -> cursor = & msg -> cursor ;
29942995 data -> pages = pages ;
29952996 data -> length = length ;
29962997 data -> alignment = alignment & ~PAGE_MASK ;
@@ -3012,6 +3013,7 @@ void ceph_msg_data_set_pagelist(struct ceph_msg *msg,
30123013
30133014 data = ceph_msg_data_create (CEPH_MSG_DATA_PAGELIST );
30143015 BUG_ON (!data );
3016+ data -> cursor = & msg -> cursor ;
30153017 data -> pagelist = pagelist ;
30163018
30173019 msg -> data = data ;
@@ -3031,6 +3033,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio,
30313033
30323034 data = ceph_msg_data_create (CEPH_MSG_DATA_BIO );
30333035 BUG_ON (!data );
3036+ data -> cursor = & msg -> cursor ;
30343037 data -> bio = bio ;
30353038 data -> bio_length = length ;
30363039
0 commit comments