diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-03-30 06:54:42 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:45:09 -0500 |
commit | e658983af6e62304be785cd6b0ae756723057395 (patch) | |
tree | 6dd2e2c85c704fb353d02feeb25cfc44613405e1 /drivers/block/drbd/drbd_int.h | |
parent | 50d0b1ad78b99aa776c3ddf9b1d45163fff435b9 (diff) |
drbd: Remove headers from on-the-wire data structures (struct p_*)
Prepare the introduction of the protocol 100 headers. The actual protocol
header is removed for the packet declarations. I.e. allow us to use the
packets with different headers.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index cb16783e78df..6d55bb75a081 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -307,32 +307,8 @@ struct p_header95 { | |||
307 | u32 length; /* Use only 24 bits of that. Ignore the highest 8 bit. */ | 307 | u32 length; /* Use only 24 bits of that. Ignore the highest 8 bit. */ |
308 | } __packed; | 308 | } __packed; |
309 | 309 | ||
310 | struct p_header { | ||
311 | union { | ||
312 | struct p_header80 h80; | ||
313 | struct p_header95 h95; | ||
314 | }; | ||
315 | u8 payload[0]; | ||
316 | }; | ||
317 | |||
318 | extern unsigned int drbd_header_size(struct drbd_tconn *tconn); | 310 | extern unsigned int drbd_header_size(struct drbd_tconn *tconn); |
319 | 311 | ||
320 | /* | ||
321 | * short commands, packets without payload, plain p_header: | ||
322 | * P_PING | ||
323 | * P_PING_ACK | ||
324 | * P_BECOME_SYNC_TARGET | ||
325 | * P_BECOME_SYNC_SOURCE | ||
326 | * P_UNPLUG_REMOTE | ||
327 | */ | ||
328 | |||
329 | /* | ||
330 | * commands with out-of-struct payload: | ||
331 | * P_BITMAP (no additional fields) | ||
332 | * P_DATA, P_DATA_REPLY (see p_data) | ||
333 | * P_COMPRESSED_BITMAP (see receive_compressed_bitmap) | ||
334 | */ | ||
335 | |||
336 | /* these defines must not be changed without changing the protocol version */ | 312 | /* these defines must not be changed without changing the protocol version */ |
337 | #define DP_HARDBARRIER 1 /* depricated */ | 313 | #define DP_HARDBARRIER 1 /* depricated */ |
338 | #define DP_RW_SYNC 2 /* equals REQ_SYNC */ | 314 | #define DP_RW_SYNC 2 /* equals REQ_SYNC */ |
@@ -343,7 +319,6 @@ extern unsigned int drbd_header_size(struct drbd_tconn *tconn); | |||
343 | #define DP_DISCARD 64 /* equals REQ_DISCARD */ | 319 | #define DP_DISCARD 64 /* equals REQ_DISCARD */ |
344 | 320 | ||
345 | struct p_data { | 321 | struct p_data { |
346 | struct p_header head; | ||
347 | u64 sector; /* 64 bits sector number */ | 322 | u64 sector; /* 64 bits sector number */ |
348 | u64 block_id; /* to identify the request in protocol B&C */ | 323 | u64 block_id; /* to identify the request in protocol B&C */ |
349 | u32 seq_num; | 324 | u32 seq_num; |
@@ -359,7 +334,6 @@ struct p_data { | |||
359 | * P_DATA_REQUEST, P_RS_DATA_REQUEST | 334 | * P_DATA_REQUEST, P_RS_DATA_REQUEST |
360 | */ | 335 | */ |
361 | struct p_block_ack { | 336 | struct p_block_ack { |
362 | struct p_header head; | ||
363 | u64 sector; | 337 | u64 sector; |
364 | u64 block_id; | 338 | u64 block_id; |
365 | u32 blksize; | 339 | u32 blksize; |
@@ -367,7 +341,6 @@ struct p_block_ack { | |||
367 | } __packed; | 341 | } __packed; |
368 | 342 | ||
369 | struct p_block_req { | 343 | struct p_block_req { |
370 | struct p_header head; | ||
371 | u64 sector; | 344 | u64 sector; |
372 | u64 block_id; | 345 | u64 block_id; |
373 | u32 blksize; | 346 | u32 blksize; |
@@ -384,7 +357,6 @@ struct p_block_req { | |||
384 | */ | 357 | */ |
385 | 358 | ||
386 | struct p_connection_features { | 359 | struct p_connection_features { |
387 | struct p_header head; /* Note: vnr will be ignored */ | ||
388 | u32 protocol_min; | 360 | u32 protocol_min; |
389 | u32 feature_flags; | 361 | u32 feature_flags; |
390 | u32 protocol_max; | 362 | u32 protocol_max; |
@@ -396,22 +368,18 @@ struct p_connection_features { | |||
396 | u32 _pad; | 368 | u32 _pad; |
397 | u64 reserverd[7]; | 369 | u64 reserverd[7]; |
398 | } __packed; | 370 | } __packed; |
399 | /* 80 bytes, FIXED for the next century */ | ||
400 | 371 | ||
401 | struct p_barrier { | 372 | struct p_barrier { |
402 | struct p_header head; | ||
403 | u32 barrier; /* barrier number _handle_ only */ | 373 | u32 barrier; /* barrier number _handle_ only */ |
404 | u32 pad; /* to multiple of 8 Byte */ | 374 | u32 pad; /* to multiple of 8 Byte */ |
405 | } __packed; | 375 | } __packed; |
406 | 376 | ||
407 | struct p_barrier_ack { | 377 | struct p_barrier_ack { |
408 | struct p_header head; | ||
409 | u32 barrier; | 378 | u32 barrier; |
410 | u32 set_size; | 379 | u32 set_size; |
411 | } __packed; | 380 | } __packed; |
412 | 381 | ||
413 | struct p_rs_param { | 382 | struct p_rs_param { |
414 | struct p_header head; | ||
415 | u32 rate; | 383 | u32 rate; |
416 | 384 | ||
417 | /* Since protocol version 88 and higher. */ | 385 | /* Since protocol version 88 and higher. */ |
@@ -419,7 +387,6 @@ struct p_rs_param { | |||
419 | } __packed; | 387 | } __packed; |
420 | 388 | ||
421 | struct p_rs_param_89 { | 389 | struct p_rs_param_89 { |
422 | struct p_header head; | ||
423 | u32 rate; | 390 | u32 rate; |
424 | /* protocol version 89: */ | 391 | /* protocol version 89: */ |
425 | char verify_alg[SHARED_SECRET_MAX]; | 392 | char verify_alg[SHARED_SECRET_MAX]; |
@@ -427,7 +394,6 @@ struct p_rs_param_89 { | |||
427 | } __packed; | 394 | } __packed; |
428 | 395 | ||
429 | struct p_rs_param_95 { | 396 | struct p_rs_param_95 { |
430 | struct p_header head; | ||
431 | u32 rate; | 397 | u32 rate; |
432 | char verify_alg[SHARED_SECRET_MAX]; | 398 | char verify_alg[SHARED_SECRET_MAX]; |
433 | char csums_alg[SHARED_SECRET_MAX]; | 399 | char csums_alg[SHARED_SECRET_MAX]; |
@@ -443,7 +409,6 @@ enum drbd_conn_flags { | |||
443 | }; | 409 | }; |
444 | 410 | ||
445 | struct p_protocol { | 411 | struct p_protocol { |
446 | struct p_header head; | ||
447 | u32 protocol; | 412 | u32 protocol; |
448 | u32 after_sb_0p; | 413 | u32 after_sb_0p; |
449 | u32 after_sb_1p; | 414 | u32 after_sb_1p; |
@@ -457,17 +422,14 @@ struct p_protocol { | |||
457 | } __packed; | 422 | } __packed; |
458 | 423 | ||
459 | struct p_uuids { | 424 | struct p_uuids { |
460 | struct p_header head; | ||
461 | u64 uuid[UI_EXTENDED_SIZE]; | 425 | u64 uuid[UI_EXTENDED_SIZE]; |
462 | } __packed; | 426 | } __packed; |
463 | 427 | ||
464 | struct p_rs_uuid { | 428 | struct p_rs_uuid { |
465 | struct p_header head; | ||
466 | u64 uuid; | 429 | u64 uuid; |
467 | } __packed; | 430 | } __packed; |
468 | 431 | ||
469 | struct p_sizes { | 432 | struct p_sizes { |
470 | struct p_header head; | ||
471 | u64 d_size; /* size of disk */ | 433 | u64 d_size; /* size of disk */ |
472 | u64 u_size; /* user requested size */ | 434 | u64 u_size; /* user requested size */ |
473 | u64 c_size; /* current exported size */ | 435 | u64 c_size; /* current exported size */ |
@@ -477,18 +439,15 @@ struct p_sizes { | |||
477 | } __packed; | 439 | } __packed; |
478 | 440 | ||
479 | struct p_state { | 441 | struct p_state { |
480 | struct p_header head; | ||
481 | u32 state; | 442 | u32 state; |
482 | } __packed; | 443 | } __packed; |
483 | 444 | ||
484 | struct p_req_state { | 445 | struct p_req_state { |
485 | struct p_header head; | ||
486 | u32 mask; | 446 | u32 mask; |
487 | u32 val; | 447 | u32 val; |
488 | } __packed; | 448 | } __packed; |
489 | 449 | ||
490 | struct p_req_state_reply { | 450 | struct p_req_state_reply { |
491 | struct p_header head; | ||
492 | u32 retcode; | 451 | u32 retcode; |
493 | } __packed; | 452 | } __packed; |
494 | 453 | ||
@@ -503,14 +462,12 @@ struct p_drbd06_param { | |||
503 | } __packed; | 462 | } __packed; |
504 | 463 | ||
505 | struct p_discard { | 464 | struct p_discard { |
506 | struct p_header head; | ||
507 | u64 block_id; | 465 | u64 block_id; |
508 | u32 seq_num; | 466 | u32 seq_num; |
509 | u32 pad; | 467 | u32 pad; |
510 | } __packed; | 468 | } __packed; |
511 | 469 | ||
512 | struct p_block_desc { | 470 | struct p_block_desc { |
513 | struct p_header head; | ||
514 | u64 sector; | 471 | u64 sector; |
515 | u32 blksize; | 472 | u32 blksize; |
516 | u32 pad; /* to multiple of 8 Byte */ | 473 | u32 pad; /* to multiple of 8 Byte */ |
@@ -526,7 +483,6 @@ enum drbd_bitmap_code { | |||
526 | }; | 483 | }; |
527 | 484 | ||
528 | struct p_compressed_bm { | 485 | struct p_compressed_bm { |
529 | struct p_header head; | ||
530 | /* (encoding & 0x0f): actual encoding, see enum drbd_bitmap_code | 486 | /* (encoding & 0x0f): actual encoding, see enum drbd_bitmap_code |
531 | * (encoding & 0x80): polarity (set/unset) of first runlength | 487 | * (encoding & 0x80): polarity (set/unset) of first runlength |
532 | * ((encoding >> 4) & 0x07): pad_bits, number of trailing zero bits | 488 | * ((encoding >> 4) & 0x07): pad_bits, number of trailing zero bits |
@@ -538,7 +494,6 @@ struct p_compressed_bm { | |||
538 | } __packed; | 494 | } __packed; |
539 | 495 | ||
540 | struct p_delay_probe93 { | 496 | struct p_delay_probe93 { |
541 | struct p_header head; | ||
542 | u32 seq_num; /* sequence number to match the two probe packets */ | 497 | u32 seq_num; /* sequence number to match the two probe packets */ |
543 | u32 offset; /* usecs the probe got sent after the reference time point */ | 498 | u32 offset; /* usecs the probe got sent after the reference time point */ |
544 | } __packed; | 499 | } __packed; |