Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libceph: move msgr1 protocol specific fields to its own struct

A couple whitespace fixups, no functional changes.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

+257 -247
+41 -35
include/linux/ceph/messenger.h
··· 264 264 #define BASE_DELAY_INTERVAL (HZ / 4) 265 265 #define MAX_DELAY_INTERVAL (15 * HZ) 266 266 267 + struct ceph_connection_v1_info { 268 + struct kvec out_kvec[8], /* sending header/footer data */ 269 + *out_kvec_cur; 270 + int out_kvec_left; /* kvec's left in out_kvec */ 271 + int out_skip; /* skip this many bytes */ 272 + int out_kvec_bytes; /* total bytes left */ 273 + bool out_more; /* there is more data after the kvecs */ 274 + bool out_msg_done; 275 + 276 + struct ceph_auth_handshake *auth; 277 + int auth_retry; /* true if we need a newer authorizer */ 278 + 279 + /* connection negotiation temps */ 280 + u8 in_banner[CEPH_BANNER_MAX_LEN]; 281 + struct ceph_entity_addr actual_peer_addr; 282 + struct ceph_entity_addr peer_addr_for_me; 283 + struct ceph_msg_connect out_connect; 284 + struct ceph_msg_connect_reply in_reply; 285 + 286 + int in_base_pos; /* bytes read */ 287 + 288 + /* message in temps */ 289 + u8 in_tag; /* protocol control byte */ 290 + struct ceph_msg_header in_hdr; 291 + __le64 in_temp_ack; /* for reading an ack */ 292 + 293 + /* message out temps */ 294 + struct ceph_msg_header out_hdr; 295 + __le64 out_temp_ack; /* for writing an ack */ 296 + struct ceph_timespec out_temp_keepalive2; /* for writing keepalive2 297 + stamp */ 298 + 299 + u32 connect_seq; /* identify the most recent connection 300 + attempt for this session */ 301 + u32 peer_global_seq; /* peer's global seq for this connection */ 302 + }; 303 + 267 304 /* 268 305 * A single connection with another host. 269 306 * ··· 318 281 int state; /* CEPH_CON_S_* */ 319 282 atomic_t sock_state; 320 283 struct socket *sock; 321 - struct ceph_entity_addr peer_addr; /* peer address */ 322 - struct ceph_entity_addr peer_addr_for_me; 323 284 324 285 unsigned long flags; /* CEPH_CON_F_* */ 325 286 const char *error_msg; /* error message, if any */ 326 287 327 288 struct ceph_entity_name peer_name; /* peer name */ 328 - 289 + struct ceph_entity_addr peer_addr; /* peer address */ 329 290 u64 peer_features; 330 - u32 connect_seq; /* identify the most recent connection 331 - attempt for this connection, client */ 332 - u32 peer_global_seq; /* peer's global seq for this connection */ 333 - 334 - struct ceph_auth_handshake *auth; 335 - int auth_retry; /* true if we need a newer authorizer */ 336 291 337 292 struct mutex mutex; 338 293 ··· 335 306 336 307 u64 in_seq, in_seq_acked; /* last message received, acked */ 337 308 338 - /* connection negotiation temps */ 339 - char in_banner[CEPH_BANNER_MAX_LEN]; 340 - struct ceph_msg_connect out_connect; 341 - struct ceph_msg_connect_reply in_reply; 342 - struct ceph_entity_addr actual_peer_addr; 343 - 344 - /* message out temps */ 345 - struct ceph_msg_header out_hdr; 309 + struct ceph_msg *in_msg; 346 310 struct ceph_msg *out_msg; /* sending message (== tail of 347 311 out_sent) */ 348 - bool out_msg_done; 349 312 350 - struct kvec out_kvec[8], /* sending header/footer data */ 351 - *out_kvec_cur; 352 - int out_kvec_left; /* kvec's left in out_kvec */ 353 - int out_skip; /* skip this many bytes */ 354 - int out_kvec_bytes; /* total bytes left */ 355 - int out_more; /* there is more data after the kvecs */ 356 - __le64 out_temp_ack; /* for writing an ack */ 357 - struct ceph_timespec out_temp_keepalive2; /* for writing keepalive2 358 - stamp */ 359 - 360 - /* message in temps */ 361 - struct ceph_msg_header in_hdr; 362 - struct ceph_msg *in_msg; 363 313 u32 in_front_crc, in_middle_crc, in_data_crc; /* calculated crc */ 364 - 365 - char in_tag; /* protocol control byte */ 366 - int in_base_pos; /* bytes read */ 367 - __le64 in_temp_ack; /* for reading an ack */ 368 314 369 315 struct timespec64 last_keepalive_ack; /* keepalive2 ack stamp */ 370 316 371 317 struct delayed_work work; /* send|recv work */ 372 318 unsigned long delay; /* current delay interval */ 319 + 320 + struct ceph_connection_v1_info v1; 373 321 }; 374 322 375 323 extern struct page *ceph_zero_page;
+4 -4
net/ceph/messenger.c
··· 1448 1448 * in case we faulted due to authentication, invalidate our 1449 1449 * current tickets so that we can get new ones. 1450 1450 */ 1451 - if (con->auth_retry) { 1452 - dout("auth_retry %d, invalidating\n", con->auth_retry); 1451 + if (con->v1.auth_retry) { 1452 + dout("auth_retry %d, invalidating\n", con->v1.auth_retry); 1453 1453 if (con->ops->invalidate_authorizer) 1454 1454 con->ops->invalidate_authorizer(con); 1455 - con->auth_retry = 0; 1455 + con->v1.auth_retry = 0; 1456 1456 } 1457 1457 1458 1458 if (con->ops->fault) ··· 1631 1631 if (con->state == CEPH_CON_S_STANDBY) { 1632 1632 dout("clear_standby %p and ++connect_seq\n", con); 1633 1633 con->state = CEPH_CON_S_PREOPEN; 1634 - con->connect_seq++; 1634 + con->v1.connect_seq++; 1635 1635 WARN_ON(ceph_con_flag_test(con, CEPH_CON_F_WRITE_PENDING)); 1636 1636 WARN_ON(ceph_con_flag_test(con, CEPH_CON_F_KEEPALIVE_PENDING)); 1637 1637 }
+212 -208
net/ceph/messenger_v1.c
··· 110 110 111 111 static void con_out_kvec_reset(struct ceph_connection *con) 112 112 { 113 - BUG_ON(con->out_skip); 113 + BUG_ON(con->v1.out_skip); 114 114 115 - con->out_kvec_left = 0; 116 - con->out_kvec_bytes = 0; 117 - con->out_kvec_cur = &con->out_kvec[0]; 115 + con->v1.out_kvec_left = 0; 116 + con->v1.out_kvec_bytes = 0; 117 + con->v1.out_kvec_cur = &con->v1.out_kvec[0]; 118 118 } 119 119 120 120 static void con_out_kvec_add(struct ceph_connection *con, 121 121 size_t size, void *data) 122 122 { 123 - int index = con->out_kvec_left; 123 + int index = con->v1.out_kvec_left; 124 124 125 - BUG_ON(con->out_skip); 126 - BUG_ON(index >= ARRAY_SIZE(con->out_kvec)); 125 + BUG_ON(con->v1.out_skip); 126 + BUG_ON(index >= ARRAY_SIZE(con->v1.out_kvec)); 127 127 128 - con->out_kvec[index].iov_len = size; 129 - con->out_kvec[index].iov_base = data; 130 - con->out_kvec_left++; 131 - con->out_kvec_bytes += size; 128 + con->v1.out_kvec[index].iov_len = size; 129 + con->v1.out_kvec[index].iov_base = data; 130 + con->v1.out_kvec_left++; 131 + con->v1.out_kvec_bytes += size; 132 132 } 133 133 134 134 /* ··· 138 138 */ 139 139 static int con_out_kvec_skip(struct ceph_connection *con) 140 140 { 141 - int off = con->out_kvec_cur - con->out_kvec; 142 141 int skip = 0; 143 142 144 - if (con->out_kvec_bytes > 0) { 145 - skip = con->out_kvec[off + con->out_kvec_left - 1].iov_len; 146 - BUG_ON(con->out_kvec_bytes < skip); 147 - BUG_ON(!con->out_kvec_left); 148 - con->out_kvec_bytes -= skip; 149 - con->out_kvec_left--; 143 + if (con->v1.out_kvec_bytes > 0) { 144 + skip = con->v1.out_kvec_cur[con->v1.out_kvec_left - 1].iov_len; 145 + BUG_ON(con->v1.out_kvec_bytes < skip); 146 + BUG_ON(!con->v1.out_kvec_left); 147 + con->v1.out_kvec_bytes -= skip; 148 + con->v1.out_kvec_left--; 150 149 } 151 150 152 151 return skip; ··· 185 186 } else { 186 187 m->old_footer.flags = m->footer.flags; 187 188 } 188 - con->out_more = m->more_to_follow; 189 - con->out_msg_done = true; 189 + con->v1.out_more = m->more_to_follow; 190 + con->v1.out_msg_done = true; 190 191 } 191 192 192 193 /* ··· 198 199 u32 crc; 199 200 200 201 con_out_kvec_reset(con); 201 - con->out_msg_done = false; 202 + con->v1.out_msg_done = false; 202 203 203 204 /* Sneak an ack in there first? If we can get it into the same 204 205 * TCP packet that's a good thing. */ 205 206 if (con->in_seq > con->in_seq_acked) { 206 207 con->in_seq_acked = con->in_seq; 207 208 con_out_kvec_add(con, sizeof (tag_ack), &tag_ack); 208 - con->out_temp_ack = cpu_to_le64(con->in_seq_acked); 209 - con_out_kvec_add(con, sizeof (con->out_temp_ack), 210 - &con->out_temp_ack); 209 + con->v1.out_temp_ack = cpu_to_le64(con->in_seq_acked); 210 + con_out_kvec_add(con, sizeof(con->v1.out_temp_ack), 211 + &con->v1.out_temp_ack); 211 212 } 212 213 213 214 ceph_con_get_out_msg(con); ··· 222 223 223 224 /* tag + hdr + front + middle */ 224 225 con_out_kvec_add(con, sizeof (tag_msg), &tag_msg); 225 - con_out_kvec_add(con, sizeof(con->out_hdr), &con->out_hdr); 226 + con_out_kvec_add(con, sizeof(con->v1.out_hdr), &con->v1.out_hdr); 226 227 con_out_kvec_add(con, m->front.iov_len, m->front.iov_base); 227 228 228 229 if (m->middle) ··· 232 233 /* fill in hdr crc and finalize hdr */ 233 234 crc = crc32c(0, &m->hdr, offsetof(struct ceph_msg_header, crc)); 234 235 con->out_msg->hdr.crc = cpu_to_le32(crc); 235 - memcpy(&con->out_hdr, &con->out_msg->hdr, sizeof(con->out_hdr)); 236 + memcpy(&con->v1.out_hdr, &con->out_msg->hdr, sizeof(con->v1.out_hdr)); 236 237 237 238 /* fill in front and middle crc, footer */ 238 239 crc = crc32c(0, m->front.iov_base, m->front.iov_len); ··· 252 253 con->out_msg->footer.data_crc = 0; 253 254 if (m->data_length) { 254 255 prepare_message_data(con->out_msg, m->data_length); 255 - con->out_more = 1; /* data + footer will follow */ 256 + con->v1.out_more = 1; /* data + footer will follow */ 256 257 } else { 257 258 /* no, queue up footer too and be done */ 258 259 prepare_write_message_footer(con); ··· 274 275 275 276 con_out_kvec_add(con, sizeof (tag_ack), &tag_ack); 276 277 277 - con->out_temp_ack = cpu_to_le64(con->in_seq_acked); 278 - con_out_kvec_add(con, sizeof (con->out_temp_ack), 279 - &con->out_temp_ack); 278 + con->v1.out_temp_ack = cpu_to_le64(con->in_seq_acked); 279 + con_out_kvec_add(con, sizeof(con->v1.out_temp_ack), 280 + &con->v1.out_temp_ack); 280 281 281 - con->out_more = 1; /* more will follow.. eventually.. */ 282 + con->v1.out_more = 1; /* more will follow.. eventually.. */ 282 283 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); 283 284 } 284 285 ··· 293 294 294 295 con_out_kvec_reset(con); 295 296 296 - con->out_temp_ack = cpu_to_le64(con->in_seq_acked); 297 - con_out_kvec_add(con, sizeof (con->out_temp_ack), 298 - &con->out_temp_ack); 297 + con->v1.out_temp_ack = cpu_to_le64(con->in_seq_acked); 298 + con_out_kvec_add(con, sizeof(con->v1.out_temp_ack), 299 + &con->v1.out_temp_ack); 299 300 300 301 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); 301 302 } ··· 312 313 313 314 ktime_get_real_ts64(&now); 314 315 con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2); 315 - ceph_encode_timespec64(&con->out_temp_keepalive2, &now); 316 - con_out_kvec_add(con, sizeof(con->out_temp_keepalive2), 317 - &con->out_temp_keepalive2); 316 + ceph_encode_timespec64(&con->v1.out_temp_keepalive2, &now); 317 + con_out_kvec_add(con, sizeof(con->v1.out_temp_keepalive2), 318 + &con->v1.out_temp_keepalive2); 318 319 } else { 319 320 con_out_kvec_add(con, sizeof(tag_keepalive), &tag_keepalive); 320 321 } ··· 331 332 int auth_proto; 332 333 333 334 if (!con->ops->get_authorizer) { 334 - con->auth = NULL; 335 - con->out_connect.authorizer_protocol = CEPH_AUTH_UNKNOWN; 336 - con->out_connect.authorizer_len = 0; 335 + con->v1.auth = NULL; 336 + con->v1.out_connect.authorizer_protocol = CEPH_AUTH_UNKNOWN; 337 + con->v1.out_connect.authorizer_len = 0; 337 338 return 0; 338 339 } 339 340 340 - auth = con->ops->get_authorizer(con, &auth_proto, con->auth_retry); 341 + auth = con->ops->get_authorizer(con, &auth_proto, con->v1.auth_retry); 341 342 if (IS_ERR(auth)) 342 343 return PTR_ERR(auth); 343 344 344 - con->auth = auth; 345 - con->out_connect.authorizer_protocol = cpu_to_le32(auth_proto); 346 - con->out_connect.authorizer_len = cpu_to_le32(auth->authorizer_buf_len); 345 + con->v1.auth = auth; 346 + con->v1.out_connect.authorizer_protocol = cpu_to_le32(auth_proto); 347 + con->v1.out_connect.authorizer_len = 348 + cpu_to_le32(auth->authorizer_buf_len); 347 349 return 0; 348 350 } 349 351 ··· 357 357 con_out_kvec_add(con, sizeof (con->msgr->my_enc_addr), 358 358 &con->msgr->my_enc_addr); 359 359 360 - con->out_more = 0; 360 + con->v1.out_more = 0; 361 361 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); 362 362 } 363 363 364 364 static void __prepare_write_connect(struct ceph_connection *con) 365 365 { 366 - con_out_kvec_add(con, sizeof(con->out_connect), &con->out_connect); 367 - if (con->auth) 368 - con_out_kvec_add(con, con->auth->authorizer_buf_len, 369 - con->auth->authorizer_buf); 366 + con_out_kvec_add(con, sizeof(con->v1.out_connect), 367 + &con->v1.out_connect); 368 + if (con->v1.auth) 369 + con_out_kvec_add(con, con->v1.auth->authorizer_buf_len, 370 + con->v1.auth->authorizer_buf); 370 371 371 - con->out_more = 0; 372 + con->v1.out_more = 0; 372 373 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); 373 374 } 374 375 ··· 394 393 } 395 394 396 395 dout("prepare_write_connect %p cseq=%d gseq=%d proto=%d\n", con, 397 - con->connect_seq, global_seq, proto); 396 + con->v1.connect_seq, global_seq, proto); 398 397 399 - con->out_connect.features = 400 - cpu_to_le64(from_msgr(con->msgr)->supported_features); 401 - con->out_connect.host_type = cpu_to_le32(CEPH_ENTITY_TYPE_CLIENT); 402 - con->out_connect.connect_seq = cpu_to_le32(con->connect_seq); 403 - con->out_connect.global_seq = cpu_to_le32(global_seq); 404 - con->out_connect.protocol_version = cpu_to_le32(proto); 405 - con->out_connect.flags = 0; 398 + con->v1.out_connect.features = 399 + cpu_to_le64(from_msgr(con->msgr)->supported_features); 400 + con->v1.out_connect.host_type = cpu_to_le32(CEPH_ENTITY_TYPE_CLIENT); 401 + con->v1.out_connect.connect_seq = cpu_to_le32(con->v1.connect_seq); 402 + con->v1.out_connect.global_seq = cpu_to_le32(global_seq); 403 + con->v1.out_connect.protocol_version = cpu_to_le32(proto); 404 + con->v1.out_connect.flags = 0; 406 405 407 406 ret = get_connect_authorizer(con); 408 407 if (ret) ··· 422 421 { 423 422 int ret; 424 423 425 - dout("write_partial_kvec %p %d left\n", con, con->out_kvec_bytes); 426 - while (con->out_kvec_bytes > 0) { 427 - ret = ceph_tcp_sendmsg(con->sock, con->out_kvec_cur, 428 - con->out_kvec_left, con->out_kvec_bytes, 429 - con->out_more); 424 + dout("write_partial_kvec %p %d left\n", con, con->v1.out_kvec_bytes); 425 + while (con->v1.out_kvec_bytes > 0) { 426 + ret = ceph_tcp_sendmsg(con->sock, con->v1.out_kvec_cur, 427 + con->v1.out_kvec_left, 428 + con->v1.out_kvec_bytes, 429 + con->v1.out_more); 430 430 if (ret <= 0) 431 431 goto out; 432 - con->out_kvec_bytes -= ret; 433 - if (con->out_kvec_bytes == 0) 432 + con->v1.out_kvec_bytes -= ret; 433 + if (!con->v1.out_kvec_bytes) 434 434 break; /* done */ 435 435 436 436 /* account for full iov entries consumed */ 437 - while (ret >= con->out_kvec_cur->iov_len) { 438 - BUG_ON(!con->out_kvec_left); 439 - ret -= con->out_kvec_cur->iov_len; 440 - con->out_kvec_cur++; 441 - con->out_kvec_left--; 437 + while (ret >= con->v1.out_kvec_cur->iov_len) { 438 + BUG_ON(!con->v1.out_kvec_left); 439 + ret -= con->v1.out_kvec_cur->iov_len; 440 + con->v1.out_kvec_cur++; 441 + con->v1.out_kvec_left--; 442 442 } 443 443 /* and for a partially-consumed entry */ 444 444 if (ret) { 445 - con->out_kvec_cur->iov_len -= ret; 446 - con->out_kvec_cur->iov_base += ret; 445 + con->v1.out_kvec_cur->iov_len -= ret; 446 + con->v1.out_kvec_cur->iov_base += ret; 447 447 } 448 448 } 449 - con->out_kvec_left = 0; 449 + con->v1.out_kvec_left = 0; 450 450 ret = 1; 451 451 out: 452 452 dout("write_partial_kvec %p %d left in %d kvecs ret = %d\n", con, 453 - con->out_kvec_bytes, con->out_kvec_left, ret); 453 + con->v1.out_kvec_bytes, con->v1.out_kvec_left, ret); 454 454 return ret; /* done! */ 455 455 } 456 456 ··· 532 530 int more = MSG_MORE | MSG_SENDPAGE_NOTLAST; 533 531 int ret; 534 532 535 - dout("%s %p %d left\n", __func__, con, con->out_skip); 536 - while (con->out_skip > 0) { 537 - size_t size = min(con->out_skip, (int) PAGE_SIZE); 533 + dout("%s %p %d left\n", __func__, con, con->v1.out_skip); 534 + while (con->v1.out_skip > 0) { 535 + size_t size = min(con->v1.out_skip, (int)PAGE_SIZE); 538 536 539 - if (size == con->out_skip) 537 + if (size == con->v1.out_skip) 540 538 more = MSG_MORE; 541 539 ret = ceph_tcp_sendpage(con->sock, ceph_zero_page, 0, size, 542 540 more); 543 541 if (ret <= 0) 544 542 goto out; 545 - con->out_skip -= ret; 543 + con->v1.out_skip -= ret; 546 544 } 547 545 ret = 1; 548 546 out: ··· 555 553 static void prepare_read_banner(struct ceph_connection *con) 556 554 { 557 555 dout("prepare_read_banner %p\n", con); 558 - con->in_base_pos = 0; 556 + con->v1.in_base_pos = 0; 559 557 } 560 558 561 559 static void prepare_read_connect(struct ceph_connection *con) 562 560 { 563 561 dout("prepare_read_connect %p\n", con); 564 - con->in_base_pos = 0; 562 + con->v1.in_base_pos = 0; 565 563 } 566 564 567 565 static void prepare_read_ack(struct ceph_connection *con) 568 566 { 569 567 dout("prepare_read_ack %p\n", con); 570 - con->in_base_pos = 0; 568 + con->v1.in_base_pos = 0; 571 569 } 572 570 573 571 static void prepare_read_seq(struct ceph_connection *con) 574 572 { 575 573 dout("prepare_read_seq %p\n", con); 576 - con->in_base_pos = 0; 577 - con->in_tag = CEPH_MSGR_TAG_SEQ; 574 + con->v1.in_base_pos = 0; 575 + con->v1.in_tag = CEPH_MSGR_TAG_SEQ; 578 576 } 579 577 580 578 static void prepare_read_tag(struct ceph_connection *con) 581 579 { 582 580 dout("prepare_read_tag %p\n", con); 583 - con->in_base_pos = 0; 584 - con->in_tag = CEPH_MSGR_TAG_READY; 581 + con->v1.in_base_pos = 0; 582 + con->v1.in_tag = CEPH_MSGR_TAG_READY; 585 583 } 586 584 587 585 static void prepare_read_keepalive_ack(struct ceph_connection *con) 588 586 { 589 587 dout("prepare_read_keepalive_ack %p\n", con); 590 - con->in_base_pos = 0; 588 + con->v1.in_base_pos = 0; 591 589 } 592 590 593 591 /* ··· 597 595 { 598 596 dout("prepare_read_message %p\n", con); 599 597 BUG_ON(con->in_msg != NULL); 600 - con->in_base_pos = 0; 598 + con->v1.in_base_pos = 0; 601 599 con->in_front_crc = con->in_middle_crc = con->in_data_crc = 0; 602 600 return 0; 603 601 } ··· 605 603 static int read_partial(struct ceph_connection *con, 606 604 int end, int size, void *object) 607 605 { 608 - while (con->in_base_pos < end) { 609 - int left = end - con->in_base_pos; 606 + while (con->v1.in_base_pos < end) { 607 + int left = end - con->v1.in_base_pos; 610 608 int have = size - left; 611 609 int ret = ceph_tcp_recvmsg(con->sock, object + have, left); 612 610 if (ret <= 0) 613 611 return ret; 614 - con->in_base_pos += ret; 612 + con->v1.in_base_pos += ret; 615 613 } 616 614 return 1; 617 615 } ··· 625 623 int end; 626 624 int ret; 627 625 628 - dout("read_partial_banner %p at %d\n", con, con->in_base_pos); 626 + dout("read_partial_banner %p at %d\n", con, con->v1.in_base_pos); 629 627 630 628 /* peer's banner */ 631 629 size = strlen(CEPH_BANNER); 632 630 end = size; 633 - ret = read_partial(con, end, size, con->in_banner); 631 + ret = read_partial(con, end, size, con->v1.in_banner); 634 632 if (ret <= 0) 635 633 goto out; 636 634 637 - size = sizeof (con->actual_peer_addr); 635 + size = sizeof(con->v1.actual_peer_addr); 638 636 end += size; 639 - ret = read_partial(con, end, size, &con->actual_peer_addr); 637 + ret = read_partial(con, end, size, &con->v1.actual_peer_addr); 640 638 if (ret <= 0) 641 639 goto out; 642 - ceph_decode_banner_addr(&con->actual_peer_addr); 640 + ceph_decode_banner_addr(&con->v1.actual_peer_addr); 643 641 644 - size = sizeof (con->peer_addr_for_me); 642 + size = sizeof(con->v1.peer_addr_for_me); 645 643 end += size; 646 - ret = read_partial(con, end, size, &con->peer_addr_for_me); 644 + ret = read_partial(con, end, size, &con->v1.peer_addr_for_me); 647 645 if (ret <= 0) 648 646 goto out; 649 - ceph_decode_banner_addr(&con->peer_addr_for_me); 647 + ceph_decode_banner_addr(&con->v1.peer_addr_for_me); 650 648 651 649 out: 652 650 return ret; ··· 658 656 int end; 659 657 int ret; 660 658 661 - dout("read_partial_connect %p at %d\n", con, con->in_base_pos); 659 + dout("read_partial_connect %p at %d\n", con, con->v1.in_base_pos); 662 660 663 - size = sizeof (con->in_reply); 661 + size = sizeof(con->v1.in_reply); 664 662 end = size; 665 - ret = read_partial(con, end, size, &con->in_reply); 663 + ret = read_partial(con, end, size, &con->v1.in_reply); 666 664 if (ret <= 0) 667 665 goto out; 668 666 669 - if (con->auth) { 670 - size = le32_to_cpu(con->in_reply.authorizer_len); 671 - if (size > con->auth->authorizer_reply_buf_len) { 667 + if (con->v1.auth) { 668 + size = le32_to_cpu(con->v1.in_reply.authorizer_len); 669 + if (size > con->v1.auth->authorizer_reply_buf_len) { 672 670 pr_err("authorizer reply too big: %d > %zu\n", size, 673 - con->auth->authorizer_reply_buf_len); 671 + con->v1.auth->authorizer_reply_buf_len); 674 672 ret = -EINVAL; 675 673 goto out; 676 674 } 677 675 678 676 end += size; 679 677 ret = read_partial(con, end, size, 680 - con->auth->authorizer_reply_buf); 678 + con->v1.auth->authorizer_reply_buf); 681 679 if (ret <= 0) 682 680 goto out; 683 681 } 684 682 685 683 dout("read_partial_connect %p tag %d, con_seq = %u, g_seq = %u\n", 686 - con, (int)con->in_reply.tag, 687 - le32_to_cpu(con->in_reply.connect_seq), 688 - le32_to_cpu(con->in_reply.global_seq)); 684 + con, con->v1.in_reply.tag, 685 + le32_to_cpu(con->v1.in_reply.connect_seq), 686 + le32_to_cpu(con->v1.in_reply.global_seq)); 689 687 out: 690 688 return ret; 691 689 } ··· 695 693 */ 696 694 static int verify_hello(struct ceph_connection *con) 697 695 { 698 - if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) { 696 + if (memcmp(con->v1.in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) { 699 697 pr_err("connect to %s got bad banner\n", 700 698 ceph_pr_addr(&con->peer_addr)); 701 699 con->error_msg = "protocol error, bad banner"; ··· 718 716 * end may not yet know their ip address, so if it's 0.0.0.0, give 719 717 * them the benefit of the doubt. 720 718 */ 721 - if (memcmp(&con->peer_addr, &con->actual_peer_addr, 719 + if (memcmp(&con->peer_addr, &con->v1.actual_peer_addr, 722 720 sizeof(con->peer_addr)) != 0 && 723 - !(ceph_addr_is_blank(&con->actual_peer_addr) && 724 - con->actual_peer_addr.nonce == con->peer_addr.nonce)) { 721 + !(ceph_addr_is_blank(&con->v1.actual_peer_addr) && 722 + con->v1.actual_peer_addr.nonce == con->peer_addr.nonce)) { 725 723 pr_warn("wrong peer, want %s/%u, got %s/%u\n", 726 724 ceph_pr_addr(&con->peer_addr), 727 725 le32_to_cpu(con->peer_addr.nonce), 728 - ceph_pr_addr(&con->actual_peer_addr), 729 - le32_to_cpu(con->actual_peer_addr.nonce)); 726 + ceph_pr_addr(&con->v1.actual_peer_addr), 727 + le32_to_cpu(con->v1.actual_peer_addr.nonce)); 730 728 con->error_msg = "wrong peer at address"; 731 729 return -1; 732 730 } ··· 736 734 */ 737 735 if (ceph_addr_is_blank(my_addr)) { 738 736 memcpy(&my_addr->in_addr, 739 - &con->peer_addr_for_me.in_addr, 740 - sizeof(con->peer_addr_for_me.in_addr)); 737 + &con->v1.peer_addr_for_me.in_addr, 738 + sizeof(con->v1.peer_addr_for_me.in_addr)); 741 739 ceph_addr_set_port(my_addr, 0); 742 740 ceph_encode_my_addr(con->msgr); 743 741 dout("process_banner learned my addr is %s\n", ··· 751 749 { 752 750 u64 sup_feat = from_msgr(con->msgr)->supported_features; 753 751 u64 req_feat = from_msgr(con->msgr)->required_features; 754 - u64 server_feat = le64_to_cpu(con->in_reply.features); 752 + u64 server_feat = le64_to_cpu(con->v1.in_reply.features); 755 753 int ret; 756 754 757 - dout("process_connect on %p tag %d\n", con, (int)con->in_tag); 755 + dout("process_connect on %p tag %d\n", con, con->v1.in_tag); 758 756 759 - if (con->auth) { 760 - int len = le32_to_cpu(con->in_reply.authorizer_len); 757 + if (con->v1.auth) { 758 + int len = le32_to_cpu(con->v1.in_reply.authorizer_len); 761 759 762 760 /* 763 761 * Any connection that defines ->get_authorizer() ··· 766 764 * 767 765 * See get_connect_authorizer(). 768 766 */ 769 - if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { 767 + if (con->v1.in_reply.tag == 768 + CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { 770 769 ret = con->ops->add_authorizer_challenge( 771 - con, con->auth->authorizer_reply_buf, len); 770 + con, con->v1.auth->authorizer_reply_buf, len); 772 771 if (ret < 0) 773 772 return ret; 774 773 ··· 788 785 } 789 786 } 790 787 791 - switch (con->in_reply.tag) { 788 + switch (con->v1.in_reply.tag) { 792 789 case CEPH_MSGR_TAG_FEATURES: 793 790 pr_err("%s%lld %s feature set mismatch," 794 791 " my %llx < server's %llx, missing %llx\n", ··· 803 800 " my %d != server's %d\n", 804 801 ENTITY_NAME(con->peer_name), 805 802 ceph_pr_addr(&con->peer_addr), 806 - le32_to_cpu(con->out_connect.protocol_version), 807 - le32_to_cpu(con->in_reply.protocol_version)); 803 + le32_to_cpu(con->v1.out_connect.protocol_version), 804 + le32_to_cpu(con->v1.in_reply.protocol_version)); 808 805 con->error_msg = "protocol version mismatch"; 809 806 return -1; 810 807 811 808 case CEPH_MSGR_TAG_BADAUTHORIZER: 812 - con->auth_retry++; 809 + con->v1.auth_retry++; 813 810 dout("process_connect %p got BADAUTHORIZER attempt %d\n", con, 814 - con->auth_retry); 815 - if (con->auth_retry == 2) { 811 + con->v1.auth_retry); 812 + if (con->v1.auth_retry == 2) { 816 813 con->error_msg = "connect authorization failure"; 817 814 return -1; 818 815 } ··· 832 829 * dropped messages. 833 830 */ 834 831 dout("process_connect got RESET peer seq %u\n", 835 - le32_to_cpu(con->in_reply.connect_seq)); 832 + le32_to_cpu(con->v1.in_reply.connect_seq)); 836 833 pr_info("%s%lld %s session reset\n", 837 834 ENTITY_NAME(con->peer_name), 838 835 ceph_pr_addr(&con->peer_addr)); ··· 858 855 * again with a larger value. 859 856 */ 860 857 dout("process_connect got RETRY_SESSION my seq %u, peer %u\n", 861 - le32_to_cpu(con->out_connect.connect_seq), 862 - le32_to_cpu(con->in_reply.connect_seq)); 863 - con->connect_seq = le32_to_cpu(con->in_reply.connect_seq); 858 + le32_to_cpu(con->v1.out_connect.connect_seq), 859 + le32_to_cpu(con->v1.in_reply.connect_seq)); 860 + con->v1.connect_seq = le32_to_cpu(con->v1.in_reply.connect_seq); 864 861 con_out_kvec_reset(con); 865 862 ret = prepare_write_connect(con); 866 863 if (ret < 0) ··· 874 871 * again with a larger value. 875 872 */ 876 873 dout("process_connect got RETRY_GLOBAL my %u peer_gseq %u\n", 877 - con->peer_global_seq, 878 - le32_to_cpu(con->in_reply.global_seq)); 874 + con->v1.peer_global_seq, 875 + le32_to_cpu(con->v1.in_reply.global_seq)); 879 876 ceph_get_global_seq(con->msgr, 880 - le32_to_cpu(con->in_reply.global_seq)); 877 + le32_to_cpu(con->v1.in_reply.global_seq)); 881 878 con_out_kvec_reset(con); 882 879 ret = prepare_write_connect(con); 883 880 if (ret < 0) ··· 899 896 900 897 WARN_ON(con->state != CEPH_CON_S_V1_CONNECT_MSG); 901 898 con->state = CEPH_CON_S_OPEN; 902 - con->auth_retry = 0; /* we authenticated; clear flag */ 903 - con->peer_global_seq = le32_to_cpu(con->in_reply.global_seq); 904 - con->connect_seq++; 899 + con->v1.auth_retry = 0; /* we authenticated; clear flag */ 900 + con->v1.peer_global_seq = 901 + le32_to_cpu(con->v1.in_reply.global_seq); 902 + con->v1.connect_seq++; 905 903 con->peer_features = server_feat; 906 904 dout("process_connect got READY gseq %d cseq %d (%d)\n", 907 - con->peer_global_seq, 908 - le32_to_cpu(con->in_reply.connect_seq), 909 - con->connect_seq); 910 - WARN_ON(con->connect_seq != 911 - le32_to_cpu(con->in_reply.connect_seq)); 905 + con->v1.peer_global_seq, 906 + le32_to_cpu(con->v1.in_reply.connect_seq), 907 + con->v1.connect_seq); 908 + WARN_ON(con->v1.connect_seq != 909 + le32_to_cpu(con->v1.in_reply.connect_seq)); 912 910 913 - if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY) 911 + if (con->v1.in_reply.flags & CEPH_MSG_CONNECT_LOSSY) 914 912 ceph_con_flag_set(con, CEPH_CON_F_LOSSYTX); 915 913 916 914 con->delay = 0; /* reset backoff memory */ 917 915 918 - if (con->in_reply.tag == CEPH_MSGR_TAG_SEQ) { 916 + if (con->v1.in_reply.tag == CEPH_MSGR_TAG_SEQ) { 919 917 prepare_write_seq(con); 920 918 prepare_read_seq(con); 921 919 } else { ··· 946 942 */ 947 943 static int read_partial_ack(struct ceph_connection *con) 948 944 { 949 - int size = sizeof (con->in_temp_ack); 945 + int size = sizeof(con->v1.in_temp_ack); 950 946 int end = size; 951 947 952 - return read_partial(con, end, size, &con->in_temp_ack); 948 + return read_partial(con, end, size, &con->v1.in_temp_ack); 953 949 } 954 950 955 951 /* ··· 957 953 */ 958 954 static void process_ack(struct ceph_connection *con) 959 955 { 960 - u64 ack = le64_to_cpu(con->in_temp_ack); 956 + u64 ack = le64_to_cpu(con->v1.in_temp_ack); 961 957 962 - if (con->in_tag == CEPH_MSGR_TAG_ACK) 958 + if (con->v1.in_tag == CEPH_MSGR_TAG_ACK) 963 959 ceph_con_discard_sent(con, ack); 964 960 else 965 961 ceph_con_discard_requeued(con, ack); ··· 1049 1045 dout("read_partial_message con %p msg %p\n", con, m); 1050 1046 1051 1047 /* header */ 1052 - size = sizeof (con->in_hdr); 1048 + size = sizeof(con->v1.in_hdr); 1053 1049 end = size; 1054 - ret = read_partial(con, end, size, &con->in_hdr); 1050 + ret = read_partial(con, end, size, &con->v1.in_hdr); 1055 1051 if (ret <= 0) 1056 1052 return ret; 1057 1053 1058 - crc = crc32c(0, &con->in_hdr, offsetof(struct ceph_msg_header, crc)); 1059 - if (cpu_to_le32(crc) != con->in_hdr.crc) { 1054 + crc = crc32c(0, &con->v1.in_hdr, offsetof(struct ceph_msg_header, crc)); 1055 + if (cpu_to_le32(crc) != con->v1.in_hdr.crc) { 1060 1056 pr_err("read_partial_message bad hdr crc %u != expected %u\n", 1061 - crc, con->in_hdr.crc); 1057 + crc, con->v1.in_hdr.crc); 1062 1058 return -EBADMSG; 1063 1059 } 1064 1060 1065 - front_len = le32_to_cpu(con->in_hdr.front_len); 1061 + front_len = le32_to_cpu(con->v1.in_hdr.front_len); 1066 1062 if (front_len > CEPH_MSG_MAX_FRONT_LEN) 1067 1063 return -EIO; 1068 - middle_len = le32_to_cpu(con->in_hdr.middle_len); 1064 + middle_len = le32_to_cpu(con->v1.in_hdr.middle_len); 1069 1065 if (middle_len > CEPH_MSG_MAX_MIDDLE_LEN) 1070 1066 return -EIO; 1071 - data_len = le32_to_cpu(con->in_hdr.data_len); 1067 + data_len = le32_to_cpu(con->v1.in_hdr.data_len); 1072 1068 if (data_len > CEPH_MSG_MAX_DATA_LEN) 1073 1069 return -EIO; 1074 1070 1075 1071 /* verify seq# */ 1076 - seq = le64_to_cpu(con->in_hdr.seq); 1072 + seq = le64_to_cpu(con->v1.in_hdr.seq); 1077 1073 if ((s64)seq - (s64)con->in_seq < 1) { 1078 1074 pr_info("skipping %s%lld %s seq %lld expected %lld\n", 1079 1075 ENTITY_NAME(con->peer_name), 1080 1076 ceph_pr_addr(&con->peer_addr), 1081 1077 seq, con->in_seq + 1); 1082 - con->in_base_pos = -front_len - middle_len - data_len - 1083 - sizeof_footer(con); 1084 - con->in_tag = CEPH_MSGR_TAG_READY; 1078 + con->v1.in_base_pos = -front_len - middle_len - data_len - 1079 + sizeof_footer(con); 1080 + con->v1.in_tag = CEPH_MSGR_TAG_READY; 1085 1081 return 1; 1086 1082 } else if ((s64)seq - (s64)con->in_seq > 1) { 1087 1083 pr_err("read_partial_message bad seq %lld expected %lld\n", ··· 1094 1090 if (!con->in_msg) { 1095 1091 int skip = 0; 1096 1092 1097 - dout("got hdr type %d front %d data %d\n", con->in_hdr.type, 1093 + dout("got hdr type %d front %d data %d\n", con->v1.in_hdr.type, 1098 1094 front_len, data_len); 1099 - ret = ceph_con_in_msg_alloc(con, &con->in_hdr, &skip); 1095 + ret = ceph_con_in_msg_alloc(con, &con->v1.in_hdr, &skip); 1100 1096 if (ret < 0) 1101 1097 return ret; 1102 1098 ··· 1104 1100 if (skip) { 1105 1101 /* skip this message */ 1106 1102 dout("alloc_msg said skip message\n"); 1107 - con->in_base_pos = -front_len - middle_len - data_len - 1108 - sizeof_footer(con); 1109 - con->in_tag = CEPH_MSGR_TAG_READY; 1103 + con->v1.in_base_pos = -front_len - middle_len - 1104 + data_len - sizeof_footer(con); 1105 + con->v1.in_tag = CEPH_MSGR_TAG_READY; 1110 1106 con->in_seq++; 1111 1107 return 1; 1112 1108 } ··· 1218 1214 1219 1215 BUG_ON(!con->sock); 1220 1216 1221 - dout("try_read tag %d in_base_pos %d\n", (int)con->in_tag, 1222 - con->in_base_pos); 1217 + dout("try_read tag %d in_base_pos %d\n", con->v1.in_tag, 1218 + con->v1.in_base_pos); 1223 1219 1224 1220 if (con->state == CEPH_CON_S_V1_BANNER) { 1225 1221 ret = read_partial_banner(con); ··· 1257 1253 1258 1254 WARN_ON(con->state != CEPH_CON_S_OPEN); 1259 1255 1260 - if (con->in_base_pos < 0) { 1256 + if (con->v1.in_base_pos < 0) { 1261 1257 /* 1262 1258 * skipping + discarding content. 1263 1259 */ 1264 - ret = ceph_tcp_recvmsg(con->sock, NULL, -con->in_base_pos); 1260 + ret = ceph_tcp_recvmsg(con->sock, NULL, -con->v1.in_base_pos); 1265 1261 if (ret <= 0) 1266 1262 goto out; 1267 - dout("skipped %d / %d bytes\n", ret, -con->in_base_pos); 1268 - con->in_base_pos += ret; 1269 - if (con->in_base_pos) 1263 + dout("skipped %d / %d bytes\n", ret, -con->v1.in_base_pos); 1264 + con->v1.in_base_pos += ret; 1265 + if (con->v1.in_base_pos) 1270 1266 goto more; 1271 1267 } 1272 - if (con->in_tag == CEPH_MSGR_TAG_READY) { 1268 + if (con->v1.in_tag == CEPH_MSGR_TAG_READY) { 1273 1269 /* 1274 1270 * what's next? 1275 1271 */ 1276 - ret = ceph_tcp_recvmsg(con->sock, &con->in_tag, 1); 1272 + ret = ceph_tcp_recvmsg(con->sock, &con->v1.in_tag, 1); 1277 1273 if (ret <= 0) 1278 1274 goto out; 1279 - dout("try_read got tag %d\n", (int)con->in_tag); 1280 - switch (con->in_tag) { 1275 + dout("try_read got tag %d\n", con->v1.in_tag); 1276 + switch (con->v1.in_tag) { 1281 1277 case CEPH_MSGR_TAG_MSG: 1282 1278 prepare_read_message(con); 1283 1279 break; ··· 1295 1291 goto bad_tag; 1296 1292 } 1297 1293 } 1298 - if (con->in_tag == CEPH_MSGR_TAG_MSG) { 1294 + if (con->v1.in_tag == CEPH_MSGR_TAG_MSG) { 1299 1295 ret = read_partial_message(con); 1300 1296 if (ret <= 0) { 1301 1297 switch (ret) { ··· 1311 1307 } 1312 1308 goto out; 1313 1309 } 1314 - if (con->in_tag == CEPH_MSGR_TAG_READY) 1310 + if (con->v1.in_tag == CEPH_MSGR_TAG_READY) 1315 1311 goto more; 1316 1312 ceph_con_process_message(con); 1317 1313 if (con->state == CEPH_CON_S_OPEN) 1318 1314 prepare_read_tag(con); 1319 1315 goto more; 1320 1316 } 1321 - if (con->in_tag == CEPH_MSGR_TAG_ACK || 1322 - con->in_tag == CEPH_MSGR_TAG_SEQ) { 1317 + if (con->v1.in_tag == CEPH_MSGR_TAG_ACK || 1318 + con->v1.in_tag == CEPH_MSGR_TAG_SEQ) { 1323 1319 /* 1324 1320 * the final handshake seq exchange is semantically 1325 1321 * equivalent to an ACK ··· 1330 1326 process_ack(con); 1331 1327 goto more; 1332 1328 } 1333 - if (con->in_tag == CEPH_MSGR_TAG_KEEPALIVE2_ACK) { 1329 + if (con->v1.in_tag == CEPH_MSGR_TAG_KEEPALIVE2_ACK) { 1334 1330 ret = read_keepalive_ack(con); 1335 1331 if (ret <= 0) 1336 1332 goto out; ··· 1342 1338 return ret; 1343 1339 1344 1340 bad_tag: 1345 - pr_err("try_read bad con->in_tag = %d\n", (int)con->in_tag); 1341 + pr_err("try_read bad tag %d\n", con->v1.in_tag); 1346 1342 con->error_msg = "protocol error, garbage tag"; 1347 1343 ret = -1; 1348 1344 goto out; ··· 1373 1369 prepare_read_banner(con); 1374 1370 1375 1371 BUG_ON(con->in_msg); 1376 - con->in_tag = CEPH_MSGR_TAG_READY; 1372 + con->v1.in_tag = CEPH_MSGR_TAG_READY; 1377 1373 dout("try_write initiating connect on %p new state %d\n", 1378 1374 con, con->state); 1379 1375 ret = ceph_tcp_connect(con); ··· 1384 1380 } 1385 1381 1386 1382 more: 1387 - dout("try_write out_kvec_bytes %d\n", con->out_kvec_bytes); 1383 + dout("try_write out_kvec_bytes %d\n", con->v1.out_kvec_bytes); 1388 1384 BUG_ON(!con->sock); 1389 1385 1390 1386 /* kvec data queued? */ 1391 - if (con->out_kvec_left) { 1387 + if (con->v1.out_kvec_left) { 1392 1388 ret = write_partial_kvec(con); 1393 1389 if (ret <= 0) 1394 1390 goto out; 1395 1391 } 1396 - if (con->out_skip) { 1392 + if (con->v1.out_skip) { 1397 1393 ret = write_partial_skip(con); 1398 1394 if (ret <= 0) 1399 1395 goto out; ··· 1401 1397 1402 1398 /* msg pages? */ 1403 1399 if (con->out_msg) { 1404 - if (con->out_msg_done) { 1400 + if (con->v1.out_msg_done) { 1405 1401 ceph_msg_put(con->out_msg); 1406 1402 con->out_msg = NULL; /* we're done with this one */ 1407 1403 goto do_next; ··· 1450 1446 { 1451 1447 struct ceph_msg *msg = con->out_msg; 1452 1448 1453 - WARN_ON(con->out_skip); 1449 + WARN_ON(con->v1.out_skip); 1454 1450 /* footer */ 1455 - if (con->out_msg_done) { 1456 - con->out_skip += con_out_kvec_skip(con); 1451 + if (con->v1.out_msg_done) { 1452 + con->v1.out_skip += con_out_kvec_skip(con); 1457 1453 } else { 1458 1454 WARN_ON(!msg->data_length); 1459 - con->out_skip += sizeof_footer(con); 1455 + con->v1.out_skip += sizeof_footer(con); 1460 1456 } 1461 1457 /* data, middle, front */ 1462 1458 if (msg->data_length) 1463 - con->out_skip += msg->cursor.total_resid; 1459 + con->v1.out_skip += msg->cursor.total_resid; 1464 1460 if (msg->middle) 1465 - con->out_skip += con_out_kvec_skip(con); 1466 - con->out_skip += con_out_kvec_skip(con); 1461 + con->v1.out_skip += con_out_kvec_skip(con); 1462 + con->v1.out_skip += con_out_kvec_skip(con); 1467 1463 1468 1464 dout("%s con %p out_kvec_bytes %d out_skip %d\n", __func__, con, 1469 - con->out_kvec_bytes, con->out_skip); 1465 + con->v1.out_kvec_bytes, con->v1.out_skip); 1470 1466 } 1471 1467 1472 1468 void ceph_con_v1_revoke_incoming(struct ceph_connection *con) 1473 1469 { 1474 - unsigned int front_len = le32_to_cpu(con->in_hdr.front_len); 1475 - unsigned int middle_len = le32_to_cpu(con->in_hdr.middle_len); 1476 - unsigned int data_len = le32_to_cpu(con->in_hdr.data_len); 1470 + unsigned int front_len = le32_to_cpu(con->v1.in_hdr.front_len); 1471 + unsigned int middle_len = le32_to_cpu(con->v1.in_hdr.middle_len); 1472 + unsigned int data_len = le32_to_cpu(con->v1.in_hdr.data_len); 1477 1473 1478 1474 /* skip rest of message */ 1479 - con->in_base_pos = con->in_base_pos - 1475 + con->v1.in_base_pos = con->v1.in_base_pos - 1480 1476 sizeof(struct ceph_msg_header) - 1481 1477 front_len - 1482 1478 middle_len - 1483 1479 data_len - 1484 1480 sizeof(struct ceph_msg_footer); 1485 1481 1486 - con->in_tag = CEPH_MSGR_TAG_READY; 1482 + con->v1.in_tag = CEPH_MSGR_TAG_READY; 1487 1483 con->in_seq++; 1488 1484 1489 - dout("%s con %p in_base_pos %d\n", __func__, con, con->in_base_pos); 1485 + dout("%s con %p in_base_pos %d\n", __func__, con, con->v1.in_base_pos); 1490 1486 } 1491 1487 1492 1488 bool ceph_con_v1_opened(struct ceph_connection *con) 1493 1489 { 1494 - return con->connect_seq; 1490 + return con->v1.connect_seq; 1495 1491 } 1496 1492 1497 1493 void ceph_con_v1_reset_session(struct ceph_connection *con) 1498 1494 { 1499 - con->connect_seq = 0; 1500 - con->peer_global_seq = 0; 1495 + con->v1.connect_seq = 0; 1496 + con->v1.peer_global_seq = 0; 1501 1497 } 1502 1498 1503 1499 void ceph_con_v1_reset_protocol(struct ceph_connection *con) 1504 1500 { 1505 - con->out_skip = 0; 1501 + con->v1.out_skip = 0; 1506 1502 }