aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-07-06 05:01:44 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2014-02-17 10:45:03 -0500
commit1ec861ebd0889263841b822ee3f3eb49caf23656 (patch)
treefd7b5305f5083702c28e4034ad8882be1bb0ed7f /drivers/block/drbd
parent3b52beffc57d6f1498a29d4edcb1cc2ad81241ec (diff)
drbd: Replace and remove the obsolete conn_() macros
With the polymorphic drbd_() macros, we no longer need the connection specific variants. Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_int.h10
-rw-r--r--drivers/block/drbd/drbd_main.c28
-rw-r--r--drivers/block/drbd/drbd_nl.c24
-rw-r--r--drivers/block/drbd/drbd_receiver.c134
-rw-r--r--drivers/block/drbd/drbd_state.c10
-rw-r--r--drivers/block/drbd/drbd_worker.c2
6 files changed, 99 insertions, 109 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 06262f5389d0..417241a14b3e 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -147,16 +147,6 @@ void drbd_printk_with_wrong_object_type(void);
147#define dynamic_drbd_dbg(device, fmt, args...) \ 147#define dynamic_drbd_dbg(device, fmt, args...) \
148 dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args) 148 dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args)
149 149
150#define conn_printk(LEVEL, TCONN, FMT, ARGS...) \
151 printk(LEVEL "d-con %s: " FMT, TCONN->resource->name , ## ARGS)
152#define conn_alert(TCONN, FMT, ARGS...) conn_printk(KERN_ALERT, TCONN, FMT, ## ARGS)
153#define conn_crit(TCONN, FMT, ARGS...) conn_printk(KERN_CRIT, TCONN, FMT, ## ARGS)
154#define conn_err(TCONN, FMT, ARGS...) conn_printk(KERN_ERR, TCONN, FMT, ## ARGS)
155#define conn_warn(TCONN, FMT, ARGS...) conn_printk(KERN_WARNING, TCONN, FMT, ## ARGS)
156#define conn_notice(TCONN, FMT, ARGS...) conn_printk(KERN_NOTICE, TCONN, FMT, ## ARGS)
157#define conn_info(TCONN, FMT, ARGS...) conn_printk(KERN_INFO, TCONN, FMT, ## ARGS)
158#define conn_dbg(TCONN, FMT, ARGS...) conn_printk(KERN_DEBUG, TCONN, FMT, ## ARGS)
159
160#define D_ASSERT(exp) if (!(exp)) \ 150#define D_ASSERT(exp) if (!(exp)) \
161 drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__) 151 drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__)
162 152
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 6e64e6e45e35..9e2c8f9d7a0b 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -227,18 +227,18 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
227 227
228 /* first some paranoia code */ 228 /* first some paranoia code */
229 if (req == NULL) { 229 if (req == NULL) {
230 conn_err(connection, "BAD! BarrierAck #%u received, but no epoch in tl!?\n", 230 drbd_err(connection, "BAD! BarrierAck #%u received, but no epoch in tl!?\n",
231 barrier_nr); 231 barrier_nr);
232 goto bail; 232 goto bail;
233 } 233 }
234 if (expect_epoch != barrier_nr) { 234 if (expect_epoch != barrier_nr) {
235 conn_err(connection, "BAD! BarrierAck #%u received, expected #%u!\n", 235 drbd_err(connection, "BAD! BarrierAck #%u received, expected #%u!\n",
236 barrier_nr, expect_epoch); 236 barrier_nr, expect_epoch);
237 goto bail; 237 goto bail;
238 } 238 }
239 239
240 if (expect_size != set_size) { 240 if (expect_size != set_size) {
241 conn_err(connection, "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n", 241 drbd_err(connection, "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n",
242 barrier_nr, set_size, expect_size); 242 barrier_nr, set_size, expect_size);
243 goto bail; 243 goto bail;
244 } 244 }
@@ -349,7 +349,7 @@ restart:
349 */ 349 */
350 350
351 if (thi->t_state == RESTARTING) { 351 if (thi->t_state == RESTARTING) {
352 conn_info(connection, "Restarting %s thread\n", thi->name); 352 drbd_info(connection, "Restarting %s thread\n", thi->name);
353 thi->t_state = RUNNING; 353 thi->t_state = RUNNING;
354 spin_unlock_irqrestore(&thi->t_lock, flags); 354 spin_unlock_irqrestore(&thi->t_lock, flags);
355 goto restart; 355 goto restart;
@@ -361,7 +361,7 @@ restart:
361 complete_all(&thi->stop); 361 complete_all(&thi->stop);
362 spin_unlock_irqrestore(&thi->t_lock, flags); 362 spin_unlock_irqrestore(&thi->t_lock, flags);
363 363
364 conn_info(connection, "Terminating %s\n", current->comm); 364 drbd_info(connection, "Terminating %s\n", current->comm);
365 365
366 /* Release mod reference taken when thread was started */ 366 /* Release mod reference taken when thread was started */
367 367
@@ -393,12 +393,12 @@ int drbd_thread_start(struct drbd_thread *thi)
393 393
394 switch (thi->t_state) { 394 switch (thi->t_state) {
395 case NONE: 395 case NONE:
396 conn_info(connection, "Starting %s thread (from %s [%d])\n", 396 drbd_info(connection, "Starting %s thread (from %s [%d])\n",
397 thi->name, current->comm, current->pid); 397 thi->name, current->comm, current->pid);
398 398
399 /* Get ref on module for thread - this is released when thread exits */ 399 /* Get ref on module for thread - this is released when thread exits */
400 if (!try_module_get(THIS_MODULE)) { 400 if (!try_module_get(THIS_MODULE)) {
401 conn_err(connection, "Failed to get module reference in drbd_thread_start\n"); 401 drbd_err(connection, "Failed to get module reference in drbd_thread_start\n");
402 spin_unlock_irqrestore(&thi->t_lock, flags); 402 spin_unlock_irqrestore(&thi->t_lock, flags);
403 return false; 403 return false;
404 } 404 }
@@ -415,7 +415,7 @@ int drbd_thread_start(struct drbd_thread *thi)
415 "drbd_%c_%s", thi->name[0], thi->connection->resource->name); 415 "drbd_%c_%s", thi->name[0], thi->connection->resource->name);
416 416
417 if (IS_ERR(nt)) { 417 if (IS_ERR(nt)) {
418 conn_err(connection, "Couldn't start thread\n"); 418 drbd_err(connection, "Couldn't start thread\n");
419 419
420 kref_put(&connection->kref, drbd_destroy_connection); 420 kref_put(&connection->kref, drbd_destroy_connection);
421 module_put(THIS_MODULE); 421 module_put(THIS_MODULE);
@@ -429,7 +429,7 @@ int drbd_thread_start(struct drbd_thread *thi)
429 break; 429 break;
430 case EXITING: 430 case EXITING:
431 thi->t_state = RESTARTING; 431 thi->t_state = RESTARTING;
432 conn_info(connection, "Restarting %s thread (from %s [%d])\n", 432 drbd_info(connection, "Restarting %s thread (from %s [%d])\n",
433 thi->name, current->comm, current->pid); 433 thi->name, current->comm, current->pid);
434 /* fall through */ 434 /* fall through */
435 case RUNNING: 435 case RUNNING:
@@ -786,7 +786,7 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm
786 if (nc->tentative && connection->agreed_pro_version < 92) { 786 if (nc->tentative && connection->agreed_pro_version < 92) {
787 rcu_read_unlock(); 787 rcu_read_unlock();
788 mutex_unlock(&sock->mutex); 788 mutex_unlock(&sock->mutex);
789 conn_err(connection, "--dry-run is not supported by peer"); 789 drbd_err(connection, "--dry-run is not supported by peer");
790 return -EOPNOTSUPP; 790 return -EOPNOTSUPP;
791 } 791 }
792 792
@@ -1435,7 +1435,7 @@ static int we_should_drop_the_connection(struct drbd_connection *connection, str
1435 1435
1436 drop_it = !--connection->ko_count; 1436 drop_it = !--connection->ko_count;
1437 if (!drop_it) { 1437 if (!drop_it) {
1438 conn_err(connection, "[%s/%d] sock_sendmsg time expired, ko = %u\n", 1438 drbd_err(connection, "[%s/%d] sock_sendmsg time expired, ko = %u\n",
1439 current->comm, current->pid, connection->ko_count); 1439 current->comm, current->pid, connection->ko_count);
1440 request_ping(connection); 1440 request_ping(connection);
1441 } 1441 }
@@ -1800,7 +1800,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
1800 1800
1801 if (rv <= 0) { 1801 if (rv <= 0) {
1802 if (rv != -EAGAIN) { 1802 if (rv != -EAGAIN) {
1803 conn_err(connection, "%s_sendmsg returned %d\n", 1803 drbd_err(connection, "%s_sendmsg returned %d\n",
1804 sock == connection->meta.socket ? "msock" : "sock", 1804 sock == connection->meta.socket ? "msock" : "sock",
1805 rv); 1805 rv);
1806 conn_request_state(connection, NS(conn, C_BROKEN_PIPE), CS_HARD); 1806 conn_request_state(connection, NS(conn, C_BROKEN_PIPE), CS_HARD);
@@ -2507,7 +2507,7 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op
2507 err = bitmap_parse(res_opts->cpu_mask, 32, 2507 err = bitmap_parse(res_opts->cpu_mask, 32,
2508 cpumask_bits(new_cpu_mask), nr_cpu_ids); 2508 cpumask_bits(new_cpu_mask), nr_cpu_ids);
2509 if (err) { 2509 if (err) {
2510 conn_warn(connection, "bitmap_parse() failed with %d\n", err); 2510 drbd_warn(resource, "bitmap_parse() failed with %d\n", err);
2511 /* retcode = ERR_CPU_MASK_PARSE; */ 2511 /* retcode = ERR_CPU_MASK_PARSE; */
2512 goto fail; 2512 goto fail;
2513 } 2513 }
@@ -2630,7 +2630,7 @@ void drbd_destroy_connection(struct kref *kref)
2630 struct drbd_resource *resource = connection->resource; 2630 struct drbd_resource *resource = connection->resource;
2631 2631
2632 if (atomic_read(&connection->current_epoch->epoch_size) != 0) 2632 if (atomic_read(&connection->current_epoch->epoch_size) != 0)
2633 conn_err(connection, "epoch_size:%d\n", atomic_read(&connection->current_epoch->epoch_size)); 2633 drbd_err(connection, "epoch_size:%d\n", atomic_read(&connection->current_epoch->epoch_size));
2634 kfree(connection->current_epoch); 2634 kfree(connection->current_epoch);
2635 2635
2636 idr_destroy(&connection->peer_devices); 2636 idr_destroy(&connection->peer_devices);
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 157ccf871f69..af26a0b099ca 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -392,16 +392,16 @@ static int conn_khelper(struct drbd_connection *connection, char *cmd)
392 setup_khelper_env(connection, envp); 392 setup_khelper_env(connection, envp);
393 conn_md_sync(connection); 393 conn_md_sync(connection);
394 394
395 conn_info(connection, "helper command: %s %s %s\n", usermode_helper, cmd, resource_name); 395 drbd_info(connection, "helper command: %s %s %s\n", usermode_helper, cmd, resource_name);
396 /* TODO: conn_bcast_event() ?? */ 396 /* TODO: conn_bcast_event() ?? */
397 397
398 ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC); 398 ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC);
399 if (ret) 399 if (ret)
400 conn_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n", 400 drbd_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
401 usermode_helper, cmd, resource_name, 401 usermode_helper, cmd, resource_name,
402 (ret >> 8) & 0xff, ret); 402 (ret >> 8) & 0xff, ret);
403 else 403 else
404 conn_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n", 404 drbd_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
405 usermode_helper, cmd, resource_name, 405 usermode_helper, cmd, resource_name,
406 (ret >> 8) & 0xff, ret); 406 (ret >> 8) & 0xff, ret);
407 /* TODO: conn_bcast_event() ?? */ 407 /* TODO: conn_bcast_event() ?? */
@@ -443,7 +443,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
443 int r; 443 int r;
444 444
445 if (connection->cstate >= C_WF_REPORT_PARAMS) { 445 if (connection->cstate >= C_WF_REPORT_PARAMS) {
446 conn_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n"); 446 drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n");
447 return false; 447 return false;
448 } 448 }
449 449
@@ -454,7 +454,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
454 fp = highest_fencing_policy(connection); 454 fp = highest_fencing_policy(connection);
455 switch (fp) { 455 switch (fp) {
456 case FP_NOT_AVAIL: 456 case FP_NOT_AVAIL:
457 conn_warn(connection, "Not fencing peer, I'm not even Consistent myself.\n"); 457 drbd_warn(connection, "Not fencing peer, I'm not even Consistent myself.\n");
458 goto out; 458 goto out;
459 case FP_DONT_CARE: 459 case FP_DONT_CARE:
460 return true; 460 return true;
@@ -488,24 +488,24 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
488 * This is useful when an unconnected R_SECONDARY is asked to 488 * This is useful when an unconnected R_SECONDARY is asked to
489 * become R_PRIMARY, but finds the other peer being active. */ 489 * become R_PRIMARY, but finds the other peer being active. */
490 ex_to_string = "peer is active"; 490 ex_to_string = "peer is active";
491 conn_warn(connection, "Peer is primary, outdating myself.\n"); 491 drbd_warn(connection, "Peer is primary, outdating myself.\n");
492 mask.disk = D_MASK; 492 mask.disk = D_MASK;
493 val.disk = D_OUTDATED; 493 val.disk = D_OUTDATED;
494 break; 494 break;
495 case 7: 495 case 7:
496 if (fp != FP_STONITH) 496 if (fp != FP_STONITH)
497 conn_err(connection, "fence-peer() = 7 && fencing != Stonith !!!\n"); 497 drbd_err(connection, "fence-peer() = 7 && fencing != Stonith !!!\n");
498 ex_to_string = "peer was stonithed"; 498 ex_to_string = "peer was stonithed";
499 mask.pdsk = D_MASK; 499 mask.pdsk = D_MASK;
500 val.pdsk = D_OUTDATED; 500 val.pdsk = D_OUTDATED;
501 break; 501 break;
502 default: 502 default:
503 /* The script is broken ... */ 503 /* The script is broken ... */
504 conn_err(connection, "fence-peer helper broken, returned %d\n", (r>>8)&0xff); 504 drbd_err(connection, "fence-peer helper broken, returned %d\n", (r>>8)&0xff);
505 return false; /* Eventually leave IO frozen */ 505 return false; /* Eventually leave IO frozen */
506 } 506 }
507 507
508 conn_info(connection, "fence-peer helper returned %d (%s)\n", 508 drbd_info(connection, "fence-peer helper returned %d (%s)\n",
509 (r>>8) & 0xff, ex_to_string); 509 (r>>8) & 0xff, ex_to_string);
510 510
511 out: 511 out:
@@ -519,7 +519,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
519 if (connection->connect_cnt != connect_cnt) 519 if (connection->connect_cnt != connect_cnt)
520 /* In case the connection was established and droped 520 /* In case the connection was established and droped
521 while the fence-peer handler was running, ignore it */ 521 while the fence-peer handler was running, ignore it */
522 conn_info(connection, "Ignoring fence-peer exit code\n"); 522 drbd_info(connection, "Ignoring fence-peer exit code\n");
523 else 523 else
524 _conn_request_state(connection, mask, val, CS_VERBOSE); 524 _conn_request_state(connection, mask, val, CS_VERBOSE);
525 } 525 }
@@ -545,7 +545,7 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection)
545 kref_get(&connection->kref); 545 kref_get(&connection->kref);
546 opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); 546 opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h");
547 if (IS_ERR(opa)) { 547 if (IS_ERR(opa)) {
548 conn_err(connection, "out of mem, failed to invoke fence-peer helper\n"); 548 drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n");
549 kref_put(&connection->kref, drbd_destroy_connection); 549 kref_put(&connection->kref, drbd_destroy_connection);
550 } 550 }
551} 551}
@@ -2335,7 +2335,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection
2335 rv2 = conn_request_state(connection, NS(conn, C_STANDALONE), 2335 rv2 = conn_request_state(connection, NS(conn, C_STANDALONE),
2336 CS_VERBOSE | CS_HARD); 2336 CS_VERBOSE | CS_HARD);
2337 if (rv2 < SS_SUCCESS) 2337 if (rv2 < SS_SUCCESS)
2338 conn_err(connection, 2338 drbd_err(connection,
2339 "unexpected rv2=%d in conn_try_disconnect()\n", 2339 "unexpected rv2=%d in conn_try_disconnect()\n",
2340 rv2); 2340 rv2);
2341 } 2341 }
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 2ee9023b1808..1de5cac5a8dd 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -497,9 +497,9 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
497 497
498 if (rv < 0) { 498 if (rv < 0) {
499 if (rv == -ECONNRESET) 499 if (rv == -ECONNRESET)
500 conn_info(connection, "sock was reset by peer\n"); 500 drbd_info(connection, "sock was reset by peer\n");
501 else if (rv != -ERESTARTSYS) 501 else if (rv != -ERESTARTSYS)
502 conn_err(connection, "sock_recvmsg returned %d\n", rv); 502 drbd_err(connection, "sock_recvmsg returned %d\n", rv);
503 } else if (rv == 0) { 503 } else if (rv == 0) {
504 if (test_bit(DISCONNECT_SENT, &connection->flags)) { 504 if (test_bit(DISCONNECT_SENT, &connection->flags)) {
505 long t; 505 long t;
@@ -512,7 +512,7 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
512 if (t) 512 if (t)
513 goto out; 513 goto out;
514 } 514 }
515 conn_info(connection, "sock was shut down by peer\n"); 515 drbd_info(connection, "sock was shut down by peer\n");
516 } 516 }
517 517
518 if (rv != size) 518 if (rv != size)
@@ -541,7 +541,7 @@ static int drbd_recv_all_warn(struct drbd_connection *connection, void *buf, siz
541 541
542 err = drbd_recv_all(connection, buf, size); 542 err = drbd_recv_all(connection, buf, size);
543 if (err && !signal_pending(current)) 543 if (err && !signal_pending(current))
544 conn_warn(connection, "short read (expected size %d)\n", (int)size); 544 drbd_warn(connection, "short read (expected size %d)\n", (int)size);
545 return err; 545 return err;
546} 546}
547 547
@@ -643,7 +643,7 @@ out:
643 disconnect_on_error = 0; 643 disconnect_on_error = 0;
644 break; 644 break;
645 default: 645 default:
646 conn_err(connection, "%s failed, err = %d\n", what, err); 646 drbd_err(connection, "%s failed, err = %d\n", what, err);
647 } 647 }
648 if (disconnect_on_error) 648 if (disconnect_on_error)
649 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); 649 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
@@ -726,7 +726,7 @@ out:
726 sock_release(s_listen); 726 sock_release(s_listen);
727 if (err < 0) { 727 if (err < 0) {
728 if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { 728 if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) {
729 conn_err(connection, "%s failed, err = %d\n", what, err); 729 drbd_err(connection, "%s failed, err = %d\n", what, err);
730 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); 730 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
731 } 731 }
732 } 732 }
@@ -768,7 +768,7 @@ static struct socket *drbd_wait_for_connect(struct drbd_connection *connection,
768 err = kernel_accept(ad->s_listen, &s_estab, 0); 768 err = kernel_accept(ad->s_listen, &s_estab, 0);
769 if (err < 0) { 769 if (err < 0) {
770 if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { 770 if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) {
771 conn_err(connection, "accept failed, err = %d\n", err); 771 drbd_err(connection, "accept failed, err = %d\n", err);
772 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); 772 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
773 } 773 }
774 } 774 }
@@ -909,7 +909,7 @@ static int conn_connect(struct drbd_connection *connection)
909 msock.socket = s; 909 msock.socket = s;
910 send_first_packet(connection, &msock, P_INITIAL_META); 910 send_first_packet(connection, &msock, P_INITIAL_META);
911 } else { 911 } else {
912 conn_err(connection, "Logic error in conn_connect()\n"); 912 drbd_err(connection, "Logic error in conn_connect()\n");
913 goto out_release_sockets; 913 goto out_release_sockets;
914 } 914 }
915 } 915 }
@@ -935,7 +935,7 @@ retry:
935 switch (fp) { 935 switch (fp) {
936 case P_INITIAL_DATA: 936 case P_INITIAL_DATA:
937 if (sock.socket) { 937 if (sock.socket) {
938 conn_warn(connection, "initial packet S crossed\n"); 938 drbd_warn(connection, "initial packet S crossed\n");
939 sock_release(sock.socket); 939 sock_release(sock.socket);
940 sock.socket = s; 940 sock.socket = s;
941 goto randomize; 941 goto randomize;
@@ -945,7 +945,7 @@ retry:
945 case P_INITIAL_META: 945 case P_INITIAL_META:
946 set_bit(RESOLVE_CONFLICTS, &connection->flags); 946 set_bit(RESOLVE_CONFLICTS, &connection->flags);
947 if (msock.socket) { 947 if (msock.socket) {
948 conn_warn(connection, "initial packet M crossed\n"); 948 drbd_warn(connection, "initial packet M crossed\n");
949 sock_release(msock.socket); 949 sock_release(msock.socket);
950 msock.socket = s; 950 msock.socket = s;
951 goto randomize; 951 goto randomize;
@@ -953,7 +953,7 @@ retry:
953 msock.socket = s; 953 msock.socket = s;
954 break; 954 break;
955 default: 955 default:
956 conn_warn(connection, "Error receiving initial packet\n"); 956 drbd_warn(connection, "Error receiving initial packet\n");
957 sock_release(s); 957 sock_release(s);
958randomize: 958randomize:
959 if (prandom_u32() & 1) 959 if (prandom_u32() & 1)
@@ -1021,10 +1021,10 @@ randomize:
1021 /* drbd_request_state(device, NS(conn, WFAuth)); */ 1021 /* drbd_request_state(device, NS(conn, WFAuth)); */
1022 switch (drbd_do_auth(connection)) { 1022 switch (drbd_do_auth(connection)) {
1023 case -1: 1023 case -1:
1024 conn_err(connection, "Authentication of peer failed\n"); 1024 drbd_err(connection, "Authentication of peer failed\n");
1025 return -1; 1025 return -1;
1026 case 0: 1026 case 0:
1027 conn_err(connection, "Authentication of peer failed, trying again.\n"); 1027 drbd_err(connection, "Authentication of peer failed, trying again.\n");
1028 return 0; 1028 return 0;
1029 } 1029 }
1030 } 1030 }
@@ -1100,7 +1100,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc
1100 *(__be32 *)header == cpu_to_be32(DRBD_MAGIC_100)) { 1100 *(__be32 *)header == cpu_to_be32(DRBD_MAGIC_100)) {
1101 struct p_header100 *h = header; 1101 struct p_header100 *h = header;
1102 if (h->pad != 0) { 1102 if (h->pad != 0) {
1103 conn_err(connection, "Header padding is not zero\n"); 1103 drbd_err(connection, "Header padding is not zero\n");
1104 return -EINVAL; 1104 return -EINVAL;
1105 } 1105 }
1106 pi->vnr = be16_to_cpu(h->volume); 1106 pi->vnr = be16_to_cpu(h->volume);
@@ -1119,7 +1119,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc
1119 pi->size = be16_to_cpu(h->length); 1119 pi->size = be16_to_cpu(h->length);
1120 pi->vnr = 0; 1120 pi->vnr = 0;
1121 } else { 1121 } else {
1122 conn_err(connection, "Wrong magic value 0x%08x in protocol version %d\n", 1122 drbd_err(connection, "Wrong magic value 0x%08x in protocol version %d\n",
1123 be32_to_cpu(*(__be32 *)header), 1123 be32_to_cpu(*(__be32 *)header),
1124 connection->agreed_pro_version); 1124 connection->agreed_pro_version);
1125 return -EINVAL; 1125 return -EINVAL;
@@ -1291,7 +1291,7 @@ void drbd_bump_write_ordering(struct drbd_connection *connection, enum write_ord
1291 rcu_read_unlock(); 1291 rcu_read_unlock();
1292 connection->write_ordering = wo; 1292 connection->write_ordering = wo;
1293 if (pwo != connection->write_ordering || wo == WO_bdev_flush) 1293 if (pwo != connection->write_ordering || wo == WO_bdev_flush)
1294 conn_info(connection, "Method to ensure write ordering: %s\n", write_ordering_str[connection->write_ordering]); 1294 drbd_info(connection, "Method to ensure write ordering: %s\n", write_ordering_str[connection->write_ordering]);
1295} 1295}
1296 1296
1297/** 1297/**
@@ -1451,7 +1451,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
1451 if (epoch) 1451 if (epoch)
1452 break; 1452 break;
1453 else 1453 else
1454 conn_warn(connection, "Allocation of an epoch failed, slowing down\n"); 1454 drbd_warn(connection, "Allocation of an epoch failed, slowing down\n");
1455 /* Fall through */ 1455 /* Fall through */
1456 1456
1457 case WO_bdev_flush: 1457 case WO_bdev_flush:
@@ -1467,7 +1467,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
1467 1467
1468 return 0; 1468 return 0;
1469 default: 1469 default:
1470 conn_err(connection, "Strangeness in connection->write_ordering %d\n", connection->write_ordering); 1470 drbd_err(connection, "Strangeness in connection->write_ordering %d\n", connection->write_ordering);
1471 return -EIO; 1471 return -EIO;
1472 } 1472 }
1473 1473
@@ -3149,37 +3149,37 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
3149 nc = rcu_dereference(connection->net_conf); 3149 nc = rcu_dereference(connection->net_conf);
3150 3150
3151 if (p_proto != nc->wire_protocol) { 3151 if (p_proto != nc->wire_protocol) {
3152 conn_err(connection, "incompatible %s settings\n", "protocol"); 3152 drbd_err(connection, "incompatible %s settings\n", "protocol");
3153 goto disconnect_rcu_unlock; 3153 goto disconnect_rcu_unlock;
3154 } 3154 }
3155 3155
3156 if (convert_after_sb(p_after_sb_0p) != nc->after_sb_0p) { 3156 if (convert_after_sb(p_after_sb_0p) != nc->after_sb_0p) {
3157 conn_err(connection, "incompatible %s settings\n", "after-sb-0pri"); 3157 drbd_err(connection, "incompatible %s settings\n", "after-sb-0pri");
3158 goto disconnect_rcu_unlock; 3158 goto disconnect_rcu_unlock;
3159 } 3159 }
3160 3160
3161 if (convert_after_sb(p_after_sb_1p) != nc->after_sb_1p) { 3161 if (convert_after_sb(p_after_sb_1p) != nc->after_sb_1p) {
3162 conn_err(connection, "incompatible %s settings\n", "after-sb-1pri"); 3162 drbd_err(connection, "incompatible %s settings\n", "after-sb-1pri");
3163 goto disconnect_rcu_unlock; 3163 goto disconnect_rcu_unlock;
3164 } 3164 }
3165 3165
3166 if (convert_after_sb(p_after_sb_2p) != nc->after_sb_2p) { 3166 if (convert_after_sb(p_after_sb_2p) != nc->after_sb_2p) {
3167 conn_err(connection, "incompatible %s settings\n", "after-sb-2pri"); 3167 drbd_err(connection, "incompatible %s settings\n", "after-sb-2pri");
3168 goto disconnect_rcu_unlock; 3168 goto disconnect_rcu_unlock;
3169 } 3169 }
3170 3170
3171 if (p_discard_my_data && nc->discard_my_data) { 3171 if (p_discard_my_data && nc->discard_my_data) {
3172 conn_err(connection, "incompatible %s settings\n", "discard-my-data"); 3172 drbd_err(connection, "incompatible %s settings\n", "discard-my-data");
3173 goto disconnect_rcu_unlock; 3173 goto disconnect_rcu_unlock;
3174 } 3174 }
3175 3175
3176 if (p_two_primaries != nc->two_primaries) { 3176 if (p_two_primaries != nc->two_primaries) {
3177 conn_err(connection, "incompatible %s settings\n", "allow-two-primaries"); 3177 drbd_err(connection, "incompatible %s settings\n", "allow-two-primaries");
3178 goto disconnect_rcu_unlock; 3178 goto disconnect_rcu_unlock;
3179 } 3179 }
3180 3180
3181 if (strcmp(integrity_alg, nc->integrity_alg)) { 3181 if (strcmp(integrity_alg, nc->integrity_alg)) {
3182 conn_err(connection, "incompatible %s settings\n", "data-integrity-alg"); 3182 drbd_err(connection, "incompatible %s settings\n", "data-integrity-alg");
3183 goto disconnect_rcu_unlock; 3183 goto disconnect_rcu_unlock;
3184 } 3184 }
3185 3185
@@ -3200,7 +3200,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
3200 3200
3201 peer_integrity_tfm = crypto_alloc_hash(integrity_alg, 0, CRYPTO_ALG_ASYNC); 3201 peer_integrity_tfm = crypto_alloc_hash(integrity_alg, 0, CRYPTO_ALG_ASYNC);
3202 if (!peer_integrity_tfm) { 3202 if (!peer_integrity_tfm) {
3203 conn_err(connection, "peer data-integrity-alg %s not supported\n", 3203 drbd_err(connection, "peer data-integrity-alg %s not supported\n",
3204 integrity_alg); 3204 integrity_alg);
3205 goto disconnect; 3205 goto disconnect;
3206 } 3206 }
@@ -3209,14 +3209,14 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
3209 int_dig_in = kmalloc(hash_size, GFP_KERNEL); 3209 int_dig_in = kmalloc(hash_size, GFP_KERNEL);
3210 int_dig_vv = kmalloc(hash_size, GFP_KERNEL); 3210 int_dig_vv = kmalloc(hash_size, GFP_KERNEL);
3211 if (!(int_dig_in && int_dig_vv)) { 3211 if (!(int_dig_in && int_dig_vv)) {
3212 conn_err(connection, "Allocation of buffers for data integrity checking failed\n"); 3212 drbd_err(connection, "Allocation of buffers for data integrity checking failed\n");
3213 goto disconnect; 3213 goto disconnect;
3214 } 3214 }
3215 } 3215 }
3216 3216
3217 new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL); 3217 new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL);
3218 if (!new_net_conf) { 3218 if (!new_net_conf) {
3219 conn_err(connection, "Allocation of new net_conf failed\n"); 3219 drbd_err(connection, "Allocation of new net_conf failed\n");
3220 goto disconnect; 3220 goto disconnect;
3221 } 3221 }
3222 3222
@@ -3243,7 +3243,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
3243 connection->int_dig_vv = int_dig_vv; 3243 connection->int_dig_vv = int_dig_vv;
3244 3244
3245 if (strcmp(old_net_conf->integrity_alg, integrity_alg)) 3245 if (strcmp(old_net_conf->integrity_alg, integrity_alg))
3246 conn_info(connection, "peer data-integrity-alg: %s\n", 3246 drbd_info(connection, "peer data-integrity-alg: %s\n",
3247 integrity_alg[0] ? integrity_alg : "(none)"); 3247 integrity_alg[0] ? integrity_alg : "(none)");
3248 3248
3249 synchronize_rcu(); 3249 synchronize_rcu();
@@ -3316,7 +3316,7 @@ static int ignore_remaining_packet(struct drbd_connection *connection, struct pa
3316 */ 3316 */
3317static int config_unknown_volume(struct drbd_connection *connection, struct packet_info *pi) 3317static int config_unknown_volume(struct drbd_connection *connection, struct packet_info *pi)
3318{ 3318{
3319 conn_warn(connection, "%s packet received for volume %u, which is not configured locally\n", 3319 drbd_warn(connection, "%s packet received for volume %u, which is not configured locally\n",
3320 cmdname(pi->cmd), pi->vnr); 3320 cmdname(pi->cmd), pi->vnr);
3321 return ignore_remaining_packet(connection, pi); 3321 return ignore_remaining_packet(connection, pi);
3322} 3322}
@@ -4311,7 +4311,7 @@ static int receive_bitmap(struct drbd_connection *connection, struct packet_info
4311 4311
4312static int receive_skip(struct drbd_connection *connection, struct packet_info *pi) 4312static int receive_skip(struct drbd_connection *connection, struct packet_info *pi)
4313{ 4313{
4314 conn_warn(connection, "skipping unknown optional packet type %d, l: %d!\n", 4314 drbd_warn(connection, "skipping unknown optional packet type %d, l: %d!\n",
4315 pi->cmd, pi->size); 4315 pi->cmd, pi->size);
4316 4316
4317 return ignore_remaining_packet(connection, pi); 4317 return ignore_remaining_packet(connection, pi);
@@ -4398,14 +4398,14 @@ static void drbdd(struct drbd_connection *connection)
4398 4398
4399 cmd = &drbd_cmd_handler[pi.cmd]; 4399 cmd = &drbd_cmd_handler[pi.cmd];
4400 if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) || !cmd->fn)) { 4400 if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) || !cmd->fn)) {
4401 conn_err(connection, "Unexpected data packet %s (0x%04x)", 4401 drbd_err(connection, "Unexpected data packet %s (0x%04x)",
4402 cmdname(pi.cmd), pi.cmd); 4402 cmdname(pi.cmd), pi.cmd);
4403 goto err_out; 4403 goto err_out;
4404 } 4404 }
4405 4405
4406 shs = cmd->pkt_size; 4406 shs = cmd->pkt_size;
4407 if (pi.size > shs && !cmd->expect_payload) { 4407 if (pi.size > shs && !cmd->expect_payload) {
4408 conn_err(connection, "No payload expected %s l:%d\n", 4408 drbd_err(connection, "No payload expected %s l:%d\n",
4409 cmdname(pi.cmd), pi.size); 4409 cmdname(pi.cmd), pi.size);
4410 goto err_out; 4410 goto err_out;
4411 } 4411 }
@@ -4419,7 +4419,7 @@ static void drbdd(struct drbd_connection *connection)
4419 4419
4420 err = cmd->fn(connection, &pi); 4420 err = cmd->fn(connection, &pi);
4421 if (err) { 4421 if (err) {
4422 conn_err(connection, "error receiving %s, e: %d l: %d!\n", 4422 drbd_err(connection, "error receiving %s, e: %d l: %d!\n",
4423 cmdname(pi.cmd), err, pi.size); 4423 cmdname(pi.cmd), err, pi.size);
4424 goto err_out; 4424 goto err_out;
4425 } 4425 }
@@ -4473,12 +4473,12 @@ static void conn_disconnect(struct drbd_connection *connection)
4473 rcu_read_unlock(); 4473 rcu_read_unlock();
4474 4474
4475 if (!list_empty(&connection->current_epoch->list)) 4475 if (!list_empty(&connection->current_epoch->list))
4476 conn_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n"); 4476 drbd_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n");
4477 /* ok, no more ee's on the fly, it is safe to reset the epoch_size */ 4477 /* ok, no more ee's on the fly, it is safe to reset the epoch_size */
4478 atomic_set(&connection->current_epoch->epoch_size, 0); 4478 atomic_set(&connection->current_epoch->epoch_size, 0);
4479 connection->send.seen_any_write_yet = false; 4479 connection->send.seen_any_write_yet = false;
4480 4480
4481 conn_info(connection, "Connection closed\n"); 4481 drbd_info(connection, "Connection closed\n");
4482 4482
4483 if (conn_highest_role(connection) == R_PRIMARY && conn_highest_pdsk(connection) >= D_UNKNOWN) 4483 if (conn_highest_role(connection) == R_PRIMARY && conn_highest_pdsk(connection) >= D_UNKNOWN)
4484 conn_try_outdate_peer_async(connection); 4484 conn_try_outdate_peer_async(connection);
@@ -4625,13 +4625,13 @@ static int drbd_do_features(struct drbd_connection *connection)
4625 return 0; 4625 return 0;
4626 4626
4627 if (pi.cmd != P_CONNECTION_FEATURES) { 4627 if (pi.cmd != P_CONNECTION_FEATURES) {
4628 conn_err(connection, "expected ConnectionFeatures packet, received: %s (0x%04x)\n", 4628 drbd_err(connection, "expected ConnectionFeatures packet, received: %s (0x%04x)\n",
4629 cmdname(pi.cmd), pi.cmd); 4629 cmdname(pi.cmd), pi.cmd);
4630 return -1; 4630 return -1;
4631 } 4631 }
4632 4632
4633 if (pi.size != expect) { 4633 if (pi.size != expect) {
4634 conn_err(connection, "expected ConnectionFeatures length: %u, received: %u\n", 4634 drbd_err(connection, "expected ConnectionFeatures length: %u, received: %u\n",
4635 expect, pi.size); 4635 expect, pi.size);
4636 return -1; 4636 return -1;
4637 } 4637 }
@@ -4652,13 +4652,13 @@ static int drbd_do_features(struct drbd_connection *connection)
4652 4652
4653 connection->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max); 4653 connection->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max);
4654 4654
4655 conn_info(connection, "Handshake successful: " 4655 drbd_info(connection, "Handshake successful: "
4656 "Agreed network protocol version %d\n", connection->agreed_pro_version); 4656 "Agreed network protocol version %d\n", connection->agreed_pro_version);
4657 4657
4658 return 1; 4658 return 1;
4659 4659
4660 incompat: 4660 incompat:
4661 conn_err(connection, "incompatible DRBD dialects: " 4661 drbd_err(connection, "incompatible DRBD dialects: "
4662 "I support %d-%d, peer supports %d-%d\n", 4662 "I support %d-%d, peer supports %d-%d\n",
4663 PRO_VERSION_MIN, PRO_VERSION_MAX, 4663 PRO_VERSION_MIN, PRO_VERSION_MAX,
4664 p->protocol_min, p->protocol_max); 4664 p->protocol_min, p->protocol_max);
@@ -4668,8 +4668,8 @@ static int drbd_do_features(struct drbd_connection *connection)
4668#if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE) 4668#if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE)
4669static int drbd_do_auth(struct drbd_connection *connection) 4669static int drbd_do_auth(struct drbd_connection *connection)
4670{ 4670{
4671 conn_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n"); 4671 drbd_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n");
4672 conn_err(connection, "You need to disable 'cram-hmac-alg' in drbd.conf.\n"); 4672 drbd_err(connection, "You need to disable 'cram-hmac-alg' in drbd.conf.\n");
4673 return -1; 4673 return -1;
4674} 4674}
4675#else 4675#else
@@ -4710,7 +4710,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4710 4710
4711 rv = crypto_hash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len); 4711 rv = crypto_hash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len);
4712 if (rv) { 4712 if (rv) {
4713 conn_err(connection, "crypto_hash_setkey() failed with %d\n", rv); 4713 drbd_err(connection, "crypto_hash_setkey() failed with %d\n", rv);
4714 rv = -1; 4714 rv = -1;
4715 goto fail; 4715 goto fail;
4716 } 4716 }
@@ -4734,21 +4734,21 @@ static int drbd_do_auth(struct drbd_connection *connection)
4734 } 4734 }
4735 4735
4736 if (pi.cmd != P_AUTH_CHALLENGE) { 4736 if (pi.cmd != P_AUTH_CHALLENGE) {
4737 conn_err(connection, "expected AuthChallenge packet, received: %s (0x%04x)\n", 4737 drbd_err(connection, "expected AuthChallenge packet, received: %s (0x%04x)\n",
4738 cmdname(pi.cmd), pi.cmd); 4738 cmdname(pi.cmd), pi.cmd);
4739 rv = 0; 4739 rv = 0;
4740 goto fail; 4740 goto fail;
4741 } 4741 }
4742 4742
4743 if (pi.size > CHALLENGE_LEN * 2) { 4743 if (pi.size > CHALLENGE_LEN * 2) {
4744 conn_err(connection, "expected AuthChallenge payload too big.\n"); 4744 drbd_err(connection, "expected AuthChallenge payload too big.\n");
4745 rv = -1; 4745 rv = -1;
4746 goto fail; 4746 goto fail;
4747 } 4747 }
4748 4748
4749 peers_ch = kmalloc(pi.size, GFP_NOIO); 4749 peers_ch = kmalloc(pi.size, GFP_NOIO);
4750 if (peers_ch == NULL) { 4750 if (peers_ch == NULL) {
4751 conn_err(connection, "kmalloc of peers_ch failed\n"); 4751 drbd_err(connection, "kmalloc of peers_ch failed\n");
4752 rv = -1; 4752 rv = -1;
4753 goto fail; 4753 goto fail;
4754 } 4754 }
@@ -4762,7 +4762,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4762 resp_size = crypto_hash_digestsize(connection->cram_hmac_tfm); 4762 resp_size = crypto_hash_digestsize(connection->cram_hmac_tfm);
4763 response = kmalloc(resp_size, GFP_NOIO); 4763 response = kmalloc(resp_size, GFP_NOIO);
4764 if (response == NULL) { 4764 if (response == NULL) {
4765 conn_err(connection, "kmalloc of response failed\n"); 4765 drbd_err(connection, "kmalloc of response failed\n");
4766 rv = -1; 4766 rv = -1;
4767 goto fail; 4767 goto fail;
4768 } 4768 }
@@ -4772,7 +4772,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4772 4772
4773 rv = crypto_hash_digest(&desc, &sg, sg.length, response); 4773 rv = crypto_hash_digest(&desc, &sg, sg.length, response);
4774 if (rv) { 4774 if (rv) {
4775 conn_err(connection, "crypto_hash_digest() failed with %d\n", rv); 4775 drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv);
4776 rv = -1; 4776 rv = -1;
4777 goto fail; 4777 goto fail;
4778 } 4778 }
@@ -4793,14 +4793,14 @@ static int drbd_do_auth(struct drbd_connection *connection)
4793 } 4793 }
4794 4794
4795 if (pi.cmd != P_AUTH_RESPONSE) { 4795 if (pi.cmd != P_AUTH_RESPONSE) {
4796 conn_err(connection, "expected AuthResponse packet, received: %s (0x%04x)\n", 4796 drbd_err(connection, "expected AuthResponse packet, received: %s (0x%04x)\n",
4797 cmdname(pi.cmd), pi.cmd); 4797 cmdname(pi.cmd), pi.cmd);
4798 rv = 0; 4798 rv = 0;
4799 goto fail; 4799 goto fail;
4800 } 4800 }
4801 4801
4802 if (pi.size != resp_size) { 4802 if (pi.size != resp_size) {
4803 conn_err(connection, "expected AuthResponse payload of wrong size\n"); 4803 drbd_err(connection, "expected AuthResponse payload of wrong size\n");
4804 rv = 0; 4804 rv = 0;
4805 goto fail; 4805 goto fail;
4806 } 4806 }
@@ -4813,7 +4813,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4813 4813
4814 right_response = kmalloc(resp_size, GFP_NOIO); 4814 right_response = kmalloc(resp_size, GFP_NOIO);
4815 if (right_response == NULL) { 4815 if (right_response == NULL) {
4816 conn_err(connection, "kmalloc of right_response failed\n"); 4816 drbd_err(connection, "kmalloc of right_response failed\n");
4817 rv = -1; 4817 rv = -1;
4818 goto fail; 4818 goto fail;
4819 } 4819 }
@@ -4822,7 +4822,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4822 4822
4823 rv = crypto_hash_digest(&desc, &sg, sg.length, right_response); 4823 rv = crypto_hash_digest(&desc, &sg, sg.length, right_response);
4824 if (rv) { 4824 if (rv) {
4825 conn_err(connection, "crypto_hash_digest() failed with %d\n", rv); 4825 drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv);
4826 rv = -1; 4826 rv = -1;
4827 goto fail; 4827 goto fail;
4828 } 4828 }
@@ -4830,7 +4830,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
4830 rv = !memcmp(response, right_response, resp_size); 4830 rv = !memcmp(response, right_response, resp_size);
4831 4831
4832 if (rv) 4832 if (rv)
4833 conn_info(connection, "Peer authenticated using %d bytes HMAC\n", 4833 drbd_info(connection, "Peer authenticated using %d bytes HMAC\n",
4834 resp_size); 4834 resp_size);
4835 else 4835 else
4836 rv = -1; 4836 rv = -1;
@@ -4849,7 +4849,7 @@ int drbdd_init(struct drbd_thread *thi)
4849 struct drbd_connection *connection = thi->connection; 4849 struct drbd_connection *connection = thi->connection;
4850 int h; 4850 int h;
4851 4851
4852 conn_info(connection, "receiver (re)started\n"); 4852 drbd_info(connection, "receiver (re)started\n");
4853 4853
4854 do { 4854 do {
4855 h = conn_connect(connection); 4855 h = conn_connect(connection);
@@ -4858,7 +4858,7 @@ int drbdd_init(struct drbd_thread *thi)
4858 schedule_timeout_interruptible(HZ); 4858 schedule_timeout_interruptible(HZ);
4859 } 4859 }
4860 if (h == -1) { 4860 if (h == -1) {
4861 conn_warn(connection, "Discarding network configuration.\n"); 4861 drbd_warn(connection, "Discarding network configuration.\n");
4862 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); 4862 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
4863 } 4863 }
4864 } while (h == 0); 4864 } while (h == 0);
@@ -4868,7 +4868,7 @@ int drbdd_init(struct drbd_thread *thi)
4868 4868
4869 conn_disconnect(connection); 4869 conn_disconnect(connection);
4870 4870
4871 conn_info(connection, "receiver terminated\n"); 4871 drbd_info(connection, "receiver terminated\n");
4872 return 0; 4872 return 0;
4873} 4873}
4874 4874
@@ -4883,7 +4883,7 @@ static int got_conn_RqSReply(struct drbd_connection *connection, struct packet_i
4883 set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags); 4883 set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags);
4884 } else { 4884 } else {
4885 set_bit(CONN_WD_ST_CHG_FAIL, &connection->flags); 4885 set_bit(CONN_WD_ST_CHG_FAIL, &connection->flags);
4886 conn_err(connection, "Requested state change failed by peer: %s (%d)\n", 4886 drbd_err(connection, "Requested state change failed by peer: %s (%d)\n",
4887 drbd_set_st_err_str(retcode), retcode); 4887 drbd_set_st_err_str(retcode), retcode);
4888 } 4888 }
4889 wake_up(&connection->ping_wait); 4889 wake_up(&connection->ping_wait);
@@ -5274,7 +5274,7 @@ int drbd_asender(struct drbd_thread *thi)
5274 5274
5275 rv = sched_setscheduler(current, SCHED_RR, &param); 5275 rv = sched_setscheduler(current, SCHED_RR, &param);
5276 if (rv < 0) 5276 if (rv < 0)
5277 conn_err(connection, "drbd_asender: ERROR set priority, ret=%d\n", rv); 5277 drbd_err(connection, "drbd_asender: ERROR set priority, ret=%d\n", rv);
5278 5278
5279 while (get_t_state(thi) == RUNNING) { 5279 while (get_t_state(thi) == RUNNING) {
5280 drbd_thread_current_set_cpu(thi); 5280 drbd_thread_current_set_cpu(thi);
@@ -5288,7 +5288,7 @@ int drbd_asender(struct drbd_thread *thi)
5288 5288
5289 if (test_and_clear_bit(SEND_PING, &connection->flags)) { 5289 if (test_and_clear_bit(SEND_PING, &connection->flags)) {
5290 if (drbd_send_ping(connection)) { 5290 if (drbd_send_ping(connection)) {
5291 conn_err(connection, "drbd_send_ping has failed\n"); 5291 drbd_err(connection, "drbd_send_ping has failed\n");
5292 goto reconnect; 5292 goto reconnect;
5293 } 5293 }
5294 connection->meta.socket->sk->sk_rcvtimeo = ping_timeo * HZ / 10; 5294 connection->meta.socket->sk->sk_rcvtimeo = ping_timeo * HZ / 10;
@@ -5300,7 +5300,7 @@ int drbd_asender(struct drbd_thread *thi)
5300 if (tcp_cork) 5300 if (tcp_cork)
5301 drbd_tcp_cork(connection->meta.socket); 5301 drbd_tcp_cork(connection->meta.socket);
5302 if (connection_finish_peer_reqs(connection)) { 5302 if (connection_finish_peer_reqs(connection)) {
5303 conn_err(connection, "connection_finish_peer_reqs() failed\n"); 5303 drbd_err(connection, "connection_finish_peer_reqs() failed\n");
5304 goto reconnect; 5304 goto reconnect;
5305 } 5305 }
5306 /* but unconditionally uncork unless disabled */ 5306 /* but unconditionally uncork unless disabled */
@@ -5342,7 +5342,7 @@ int drbd_asender(struct drbd_thread *thi)
5342 if (t) 5342 if (t)
5343 break; 5343 break;
5344 } 5344 }
5345 conn_err(connection, "meta connection shut down by peer.\n"); 5345 drbd_err(connection, "meta connection shut down by peer.\n");
5346 goto reconnect; 5346 goto reconnect;
5347 } else if (rv == -EAGAIN) { 5347 } else if (rv == -EAGAIN) {
5348 /* If the data socket received something meanwhile, 5348 /* If the data socket received something meanwhile,
@@ -5351,7 +5351,7 @@ int drbd_asender(struct drbd_thread *thi)
5351 jiffies - connection->meta.socket->sk->sk_rcvtimeo)) 5351 jiffies - connection->meta.socket->sk->sk_rcvtimeo))
5352 continue; 5352 continue;
5353 if (ping_timeout_active) { 5353 if (ping_timeout_active) {
5354 conn_err(connection, "PingAck did not arrive in time.\n"); 5354 drbd_err(connection, "PingAck did not arrive in time.\n");
5355 goto reconnect; 5355 goto reconnect;
5356 } 5356 }
5357 set_bit(SEND_PING, &connection->flags); 5357 set_bit(SEND_PING, &connection->flags);
@@ -5359,7 +5359,7 @@ int drbd_asender(struct drbd_thread *thi)
5359 } else if (rv == -EINTR) { 5359 } else if (rv == -EINTR) {
5360 continue; 5360 continue;
5361 } else { 5361 } else {
5362 conn_err(connection, "sock_recvmsg returned %d\n", rv); 5362 drbd_err(connection, "sock_recvmsg returned %d\n", rv);
5363 goto reconnect; 5363 goto reconnect;
5364 } 5364 }
5365 5365
@@ -5368,13 +5368,13 @@ int drbd_asender(struct drbd_thread *thi)
5368 goto reconnect; 5368 goto reconnect;
5369 cmd = &asender_tbl[pi.cmd]; 5369 cmd = &asender_tbl[pi.cmd];
5370 if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd->fn) { 5370 if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd->fn) {
5371 conn_err(connection, "Unexpected meta packet %s (0x%04x)\n", 5371 drbd_err(connection, "Unexpected meta packet %s (0x%04x)\n",
5372 cmdname(pi.cmd), pi.cmd); 5372 cmdname(pi.cmd), pi.cmd);
5373 goto disconnect; 5373 goto disconnect;
5374 } 5374 }
5375 expect = header_size + cmd->pkt_size; 5375 expect = header_size + cmd->pkt_size;
5376 if (pi.size != expect - header_size) { 5376 if (pi.size != expect - header_size) {
5377 conn_err(connection, "Wrong packet size on meta (c: %d, l: %d)\n", 5377 drbd_err(connection, "Wrong packet size on meta (c: %d, l: %d)\n",
5378 pi.cmd, pi.size); 5378 pi.cmd, pi.size);
5379 goto reconnect; 5379 goto reconnect;
5380 } 5380 }
@@ -5384,7 +5384,7 @@ int drbd_asender(struct drbd_thread *thi)
5384 5384
5385 err = cmd->fn(connection, &pi); 5385 err = cmd->fn(connection, &pi);
5386 if (err) { 5386 if (err) {
5387 conn_err(connection, "%pf failed\n", cmd->fn); 5387 drbd_err(connection, "%pf failed\n", cmd->fn);
5388 goto reconnect; 5388 goto reconnect;
5389 } 5389 }
5390 5390
@@ -5414,7 +5414,7 @@ disconnect:
5414 } 5414 }
5415 clear_bit(SIGNAL_ASENDER, &connection->flags); 5415 clear_bit(SIGNAL_ASENDER, &connection->flags);
5416 5416
5417 conn_info(connection, "asender terminated\n"); 5417 drbd_info(connection, "asender terminated\n");
5418 5418
5419 return 0; 5419 return 0;
5420} 5420}
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index df917c2067ca..e66f725ff169 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -507,7 +507,7 @@ static void conn_pr_state_change(struct drbd_connection *connection, union drbd_
507 is_susp(ns)); 507 is_susp(ns));
508 508
509 if (pbp != pb) 509 if (pbp != pb)
510 conn_info(connection, "%s\n", pb); 510 drbd_info(connection, "%s\n", pb);
511} 511}
512 512
513 513
@@ -1846,7 +1846,7 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u
1846 acscw->w.connection = connection; 1846 acscw->w.connection = connection;
1847 drbd_queue_work(&connection->sender_work, &acscw->w); 1847 drbd_queue_work(&connection->sender_work, &acscw->w);
1848 } else { 1848 } else {
1849 conn_err(connection, "Could not kmalloc an acscw\n"); 1849 drbd_err(connection, "Could not kmalloc an acscw\n");
1850 } 1850 }
1851 1851
1852 abort: 1852 abort:
@@ -1859,9 +1859,9 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u
1859 spin_lock_irq(&connection->req_lock); 1859 spin_lock_irq(&connection->req_lock);
1860 } 1860 }
1861 if (rv < SS_SUCCESS && flags & CS_VERBOSE) { 1861 if (rv < SS_SUCCESS && flags & CS_VERBOSE) {
1862 conn_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv)); 1862 drbd_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv));
1863 conn_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i); 1863 drbd_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i);
1864 conn_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn)); 1864 drbd_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn));
1865 } 1865 }
1866 return rv; 1866 return rv;
1867} 1867}
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 040e8c7ab1db..53be1eaa95de 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1905,7 +1905,7 @@ int drbd_worker(struct drbd_thread *thi)
1905 if (signal_pending(current)) { 1905 if (signal_pending(current)) {
1906 flush_signals(current); 1906 flush_signals(current);
1907 if (get_t_state(thi) == RUNNING) { 1907 if (get_t_state(thi) == RUNNING) {
1908 conn_warn(connection, "Worker got an unexpected signal\n"); 1908 drbd_warn(connection, "Worker got an unexpected signal\n");
1909 continue; 1909 continue;
1910 } 1910 }
1911 break; 1911 break;