diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2010-12-07 18:39:32 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:36:19 -0500 |
commit | bf885f8a6772fb48409dd505a09d974a5e621f22 (patch) | |
tree | 28205a11a192a14192bac3f8487b444e6d533955 /drivers/block | |
parent | c8b325632f0e5ffdaeca3d1f3be77c9399316a40 (diff) |
drbd: Be more explicit about functions that return an enum drbd_state_rv
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 32 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 59 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 29 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 2 |
4 files changed, 67 insertions, 55 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index c81710a42111..749607a494e6 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1174,14 +1174,19 @@ enum dds_flags { | |||
1174 | }; | 1174 | }; |
1175 | 1175 | ||
1176 | extern void drbd_init_set_defaults(struct drbd_conf *mdev); | 1176 | extern void drbd_init_set_defaults(struct drbd_conf *mdev); |
1177 | extern int drbd_change_state(struct drbd_conf *mdev, enum chg_state_flags f, | 1177 | extern enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev, |
1178 | union drbd_state mask, union drbd_state val); | 1178 | enum chg_state_flags f, |
1179 | union drbd_state mask, | ||
1180 | union drbd_state val); | ||
1179 | extern void drbd_force_state(struct drbd_conf *, union drbd_state, | 1181 | extern void drbd_force_state(struct drbd_conf *, union drbd_state, |
1180 | union drbd_state); | 1182 | union drbd_state); |
1181 | extern int _drbd_request_state(struct drbd_conf *, union drbd_state, | 1183 | extern enum drbd_state_rv _drbd_request_state(struct drbd_conf *, |
1182 | union drbd_state, enum chg_state_flags); | 1184 | union drbd_state, |
1183 | extern int __drbd_set_state(struct drbd_conf *, union drbd_state, | 1185 | union drbd_state, |
1184 | enum chg_state_flags, struct completion *done); | 1186 | enum chg_state_flags); |
1187 | extern enum drbd_state_rv __drbd_set_state(struct drbd_conf *, union drbd_state, | ||
1188 | enum chg_state_flags, | ||
1189 | struct completion *done); | ||
1185 | extern void print_st_err(struct drbd_conf *, union drbd_state, | 1190 | extern void print_st_err(struct drbd_conf *, union drbd_state, |
1186 | union drbd_state, int); | 1191 | union drbd_state, int); |
1187 | extern int drbd_thread_start(struct drbd_thread *thi); | 1192 | extern int drbd_thread_start(struct drbd_thread *thi); |
@@ -1245,7 +1250,7 @@ extern int drbd_send_ov_request(struct drbd_conf *mdev,sector_t sector,int size) | |||
1245 | 1250 | ||
1246 | extern int drbd_send_bitmap(struct drbd_conf *mdev); | 1251 | extern int drbd_send_bitmap(struct drbd_conf *mdev); |
1247 | extern int _drbd_send_bitmap(struct drbd_conf *mdev); | 1252 | extern int _drbd_send_bitmap(struct drbd_conf *mdev); |
1248 | extern int drbd_send_sr_reply(struct drbd_conf *mdev, int retcode); | 1253 | extern int drbd_send_sr_reply(struct drbd_conf *mdev, enum drbd_state_rv retcode); |
1249 | extern void drbd_free_bc(struct drbd_backing_dev *ldev); | 1254 | extern void drbd_free_bc(struct drbd_backing_dev *ldev); |
1250 | extern void drbd_mdev_cleanup(struct drbd_conf *mdev); | 1255 | extern void drbd_mdev_cleanup(struct drbd_conf *mdev); |
1251 | 1256 | ||
@@ -1493,8 +1498,9 @@ enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = | |||
1493 | extern enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *, enum dds_flags) __must_hold(local); | 1498 | extern enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *, enum dds_flags) __must_hold(local); |
1494 | extern void resync_after_online_grow(struct drbd_conf *); | 1499 | extern void resync_after_online_grow(struct drbd_conf *); |
1495 | extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local); | 1500 | extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local); |
1496 | extern int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, | 1501 | extern enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev, |
1497 | int force); | 1502 | enum drbd_role new_role, |
1503 | int force); | ||
1498 | extern enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev); | 1504 | extern enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev); |
1499 | extern void drbd_try_outdate_peer_async(struct drbd_conf *mdev); | 1505 | extern void drbd_try_outdate_peer_async(struct drbd_conf *mdev); |
1500 | extern int drbd_khelper(struct drbd_conf *mdev, char *cmd); | 1506 | extern int drbd_khelper(struct drbd_conf *mdev, char *cmd); |
@@ -1761,11 +1767,11 @@ static inline void drbd_state_unlock(struct drbd_conf *mdev) | |||
1761 | wake_up(&mdev->misc_wait); | 1767 | wake_up(&mdev->misc_wait); |
1762 | } | 1768 | } |
1763 | 1769 | ||
1764 | static inline int _drbd_set_state(struct drbd_conf *mdev, | 1770 | static inline enum drbd_state_rv |
1765 | union drbd_state ns, enum chg_state_flags flags, | 1771 | _drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, |
1766 | struct completion *done) | 1772 | enum chg_state_flags flags, struct completion *done) |
1767 | { | 1773 | { |
1768 | int rv; | 1774 | enum drbd_state_rv rv; |
1769 | 1775 | ||
1770 | read_lock(&global_state_lock); | 1776 | read_lock(&global_state_lock); |
1771 | rv = __drbd_set_state(mdev, ns, flags, done); | 1777 | rv = __drbd_set_state(mdev, ns, flags, done); |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index cddf311b7429..a101dceb2d49 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -473,12 +473,13 @@ static int cl_wide_st_chg(struct drbd_conf *mdev, | |||
473 | (os.conn == C_CONNECTED && ns.conn == C_VERIFY_S); | 473 | (os.conn == C_CONNECTED && ns.conn == C_VERIFY_S); |
474 | } | 474 | } |
475 | 475 | ||
476 | int drbd_change_state(struct drbd_conf *mdev, enum chg_state_flags f, | 476 | enum drbd_state_rv |
477 | union drbd_state mask, union drbd_state val) | 477 | drbd_change_state(struct drbd_conf *mdev, enum chg_state_flags f, |
478 | union drbd_state mask, union drbd_state val) | ||
478 | { | 479 | { |
479 | unsigned long flags; | 480 | unsigned long flags; |
480 | union drbd_state os, ns; | 481 | union drbd_state os, ns; |
481 | int rv; | 482 | enum drbd_state_rv rv; |
482 | 483 | ||
483 | spin_lock_irqsave(&mdev->req_lock, flags); | 484 | spin_lock_irqsave(&mdev->req_lock, flags); |
484 | os = mdev->state; | 485 | os = mdev->state; |
@@ -502,9 +503,10 @@ void drbd_force_state(struct drbd_conf *mdev, | |||
502 | drbd_change_state(mdev, CS_HARD, mask, val); | 503 | drbd_change_state(mdev, CS_HARD, mask, val); |
503 | } | 504 | } |
504 | 505 | ||
505 | static int is_valid_state(struct drbd_conf *mdev, union drbd_state ns); | 506 | static enum drbd_state_rv is_valid_state(struct drbd_conf *, union drbd_state); |
506 | static int is_valid_state_transition(struct drbd_conf *, | 507 | static enum drbd_state_rv is_valid_state_transition(struct drbd_conf *, |
507 | union drbd_state, union drbd_state); | 508 | union drbd_state, |
509 | union drbd_state); | ||
508 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state os, | 510 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state os, |
509 | union drbd_state ns, const char **warn_sync_abort); | 511 | union drbd_state ns, const char **warn_sync_abort); |
510 | int drbd_send_state_req(struct drbd_conf *, | 512 | int drbd_send_state_req(struct drbd_conf *, |
@@ -516,7 +518,7 @@ _req_st_cond(struct drbd_conf *mdev, union drbd_state mask, | |||
516 | { | 518 | { |
517 | union drbd_state os, ns; | 519 | union drbd_state os, ns; |
518 | unsigned long flags; | 520 | unsigned long flags; |
519 | int rv; | 521 | enum drbd_state_rv rv; |
520 | 522 | ||
521 | if (test_and_clear_bit(CL_ST_CHG_SUCCESS, &mdev->flags)) | 523 | if (test_and_clear_bit(CL_ST_CHG_SUCCESS, &mdev->flags)) |
522 | return SS_CW_SUCCESS; | 524 | return SS_CW_SUCCESS; |
@@ -537,7 +539,7 @@ _req_st_cond(struct drbd_conf *mdev, union drbd_state mask, | |||
537 | if (rv == SS_SUCCESS) { | 539 | if (rv == SS_SUCCESS) { |
538 | rv = is_valid_state_transition(mdev, ns, os); | 540 | rv = is_valid_state_transition(mdev, ns, os); |
539 | if (rv == SS_SUCCESS) | 541 | if (rv == SS_SUCCESS) |
540 | rv = 0; /* cont waiting, otherwise fail. */ | 542 | rv = SS_UNKNOWN_ERROR; /* cont waiting, otherwise fail. */ |
541 | } | 543 | } |
542 | } | 544 | } |
543 | spin_unlock_irqrestore(&mdev->req_lock, flags); | 545 | spin_unlock_irqrestore(&mdev->req_lock, flags); |
@@ -555,14 +557,14 @@ _req_st_cond(struct drbd_conf *mdev, union drbd_state mask, | |||
555 | * Should not be called directly, use drbd_request_state() or | 557 | * Should not be called directly, use drbd_request_state() or |
556 | * _drbd_request_state(). | 558 | * _drbd_request_state(). |
557 | */ | 559 | */ |
558 | static int drbd_req_state(struct drbd_conf *mdev, | 560 | static enum drbd_state_rv |
559 | union drbd_state mask, union drbd_state val, | 561 | drbd_req_state(struct drbd_conf *mdev, union drbd_state mask, |
560 | enum chg_state_flags f) | 562 | union drbd_state val, enum chg_state_flags f) |
561 | { | 563 | { |
562 | struct completion done; | 564 | struct completion done; |
563 | unsigned long flags; | 565 | unsigned long flags; |
564 | union drbd_state os, ns; | 566 | union drbd_state os, ns; |
565 | int rv; | 567 | enum drbd_state_rv rv; |
566 | 568 | ||
567 | init_completion(&done); | 569 | init_completion(&done); |
568 | 570 | ||
@@ -637,10 +639,11 @@ abort: | |||
637 | * Cousin of drbd_request_state(), useful with the CS_WAIT_COMPLETE | 639 | * Cousin of drbd_request_state(), useful with the CS_WAIT_COMPLETE |
638 | * flag, or when logging of failed state change requests is not desired. | 640 | * flag, or when logging of failed state change requests is not desired. |
639 | */ | 641 | */ |
640 | int _drbd_request_state(struct drbd_conf *mdev, union drbd_state mask, | 642 | enum drbd_state_rv |
641 | union drbd_state val, enum chg_state_flags f) | 643 | _drbd_request_state(struct drbd_conf *mdev, union drbd_state mask, |
644 | union drbd_state val, enum chg_state_flags f) | ||
642 | { | 645 | { |
643 | int rv; | 646 | enum drbd_state_rv rv; |
644 | 647 | ||
645 | wait_event(mdev->state_wait, | 648 | wait_event(mdev->state_wait, |
646 | (rv = drbd_req_state(mdev, mask, val, f)) != SS_IN_TRANSIENT_STATE); | 649 | (rv = drbd_req_state(mdev, mask, val, f)) != SS_IN_TRANSIENT_STATE); |
@@ -664,8 +667,8 @@ static void print_st(struct drbd_conf *mdev, char *name, union drbd_state ns) | |||
664 | ); | 667 | ); |
665 | } | 668 | } |
666 | 669 | ||
667 | void print_st_err(struct drbd_conf *mdev, | 670 | void print_st_err(struct drbd_conf *mdev, union drbd_state os, |
668 | union drbd_state os, union drbd_state ns, int err) | 671 | union drbd_state ns, enum drbd_state_rv err) |
669 | { | 672 | { |
670 | if (err == SS_IN_TRANSIENT_STATE) | 673 | if (err == SS_IN_TRANSIENT_STATE) |
671 | return; | 674 | return; |
@@ -680,12 +683,13 @@ void print_st_err(struct drbd_conf *mdev, | |||
680 | * @mdev: DRBD device. | 683 | * @mdev: DRBD device. |
681 | * @ns: State to consider. | 684 | * @ns: State to consider. |
682 | */ | 685 | */ |
683 | static int is_valid_state(struct drbd_conf *mdev, union drbd_state ns) | 686 | static enum drbd_state_rv |
687 | is_valid_state(struct drbd_conf *mdev, union drbd_state ns) | ||
684 | { | 688 | { |
685 | /* See drbd_state_sw_errors in drbd_strings.c */ | 689 | /* See drbd_state_sw_errors in drbd_strings.c */ |
686 | 690 | ||
687 | enum drbd_fencing_p fp; | 691 | enum drbd_fencing_p fp; |
688 | int rv = SS_SUCCESS; | 692 | enum drbd_state_rv rv = SS_SUCCESS; |
689 | 693 | ||
690 | fp = FP_DONT_CARE; | 694 | fp = FP_DONT_CARE; |
691 | if (get_ldev(mdev)) { | 695 | if (get_ldev(mdev)) { |
@@ -748,10 +752,11 @@ static int is_valid_state(struct drbd_conf *mdev, union drbd_state ns) | |||
748 | * @ns: new state. | 752 | * @ns: new state. |
749 | * @os: old state. | 753 | * @os: old state. |
750 | */ | 754 | */ |
751 | static int is_valid_state_transition(struct drbd_conf *mdev, | 755 | static enum drbd_state_rv |
752 | union drbd_state ns, union drbd_state os) | 756 | is_valid_state_transition(struct drbd_conf *mdev, union drbd_state ns, |
757 | union drbd_state os) | ||
753 | { | 758 | { |
754 | int rv = SS_SUCCESS; | 759 | enum drbd_state_rv rv = SS_SUCCESS; |
755 | 760 | ||
756 | if ((ns.conn == C_STARTING_SYNC_T || ns.conn == C_STARTING_SYNC_S) && | 761 | if ((ns.conn == C_STARTING_SYNC_T || ns.conn == C_STARTING_SYNC_S) && |
757 | os.conn > C_CONNECTED) | 762 | os.conn > C_CONNECTED) |
@@ -1029,12 +1034,12 @@ static void drbd_resume_al(struct drbd_conf *mdev) | |||
1029 | * | 1034 | * |
1030 | * Caller needs to hold req_lock, and global_state_lock. Do not call directly. | 1035 | * Caller needs to hold req_lock, and global_state_lock. Do not call directly. |
1031 | */ | 1036 | */ |
1032 | int __drbd_set_state(struct drbd_conf *mdev, | 1037 | enum drbd_state_rv |
1033 | union drbd_state ns, enum chg_state_flags flags, | 1038 | __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, |
1034 | struct completion *done) | 1039 | enum chg_state_flags flags, struct completion *done) |
1035 | { | 1040 | { |
1036 | union drbd_state os; | 1041 | union drbd_state os; |
1037 | int rv = SS_SUCCESS; | 1042 | enum drbd_state_rv rv = SS_SUCCESS; |
1038 | const char *warn_sync_abort = NULL; | 1043 | const char *warn_sync_abort = NULL; |
1039 | struct after_state_chg_work *ascw; | 1044 | struct after_state_chg_work *ascw; |
1040 | 1045 | ||
@@ -2031,7 +2036,7 @@ int drbd_send_state_req(struct drbd_conf *mdev, | |||
2031 | (struct p_header80 *)&p, sizeof(p)); | 2036 | (struct p_header80 *)&p, sizeof(p)); |
2032 | } | 2037 | } |
2033 | 2038 | ||
2034 | int drbd_send_sr_reply(struct drbd_conf *mdev, int retcode) | 2039 | int drbd_send_sr_reply(struct drbd_conf *mdev, enum drbd_state_rv retcode) |
2035 | { | 2040 | { |
2036 | struct p_req_state_reply p; | 2041 | struct p_req_state_reply p; |
2037 | 2042 | ||
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index fe336592e538..7a2faf6d48e2 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -288,10 +288,11 @@ void drbd_try_outdate_peer_async(struct drbd_conf *mdev) | |||
288 | dev_err(DEV, "out of mem, failed to invoke fence-peer helper\n"); | 288 | dev_err(DEV, "out of mem, failed to invoke fence-peer helper\n"); |
289 | } | 289 | } |
290 | 290 | ||
291 | int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | 291 | enum drbd_state_rv |
292 | drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | ||
292 | { | 293 | { |
293 | const int max_tries = 4; | 294 | const int max_tries = 4; |
294 | int r = 0; | 295 | enum drbd_state_rv rv = SS_UNKNOWN_ERROR; |
295 | int try = 0; | 296 | int try = 0; |
296 | int forced = 0; | 297 | int forced = 0; |
297 | union drbd_state mask, val; | 298 | union drbd_state mask, val; |
@@ -306,17 +307,17 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
306 | val.i = 0; val.role = new_role; | 307 | val.i = 0; val.role = new_role; |
307 | 308 | ||
308 | while (try++ < max_tries) { | 309 | while (try++ < max_tries) { |
309 | r = _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); | 310 | rv = _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); |
310 | 311 | ||
311 | /* in case we first succeeded to outdate, | 312 | /* in case we first succeeded to outdate, |
312 | * but now suddenly could establish a connection */ | 313 | * but now suddenly could establish a connection */ |
313 | if (r == SS_CW_FAILED_BY_PEER && mask.pdsk != 0) { | 314 | if (rv == SS_CW_FAILED_BY_PEER && mask.pdsk != 0) { |
314 | val.pdsk = 0; | 315 | val.pdsk = 0; |
315 | mask.pdsk = 0; | 316 | mask.pdsk = 0; |
316 | continue; | 317 | continue; |
317 | } | 318 | } |
318 | 319 | ||
319 | if (r == SS_NO_UP_TO_DATE_DISK && force && | 320 | if (rv == SS_NO_UP_TO_DATE_DISK && force && |
320 | (mdev->state.disk < D_UP_TO_DATE && | 321 | (mdev->state.disk < D_UP_TO_DATE && |
321 | mdev->state.disk >= D_INCONSISTENT)) { | 322 | mdev->state.disk >= D_INCONSISTENT)) { |
322 | mask.disk = D_MASK; | 323 | mask.disk = D_MASK; |
@@ -325,7 +326,7 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
325 | continue; | 326 | continue; |
326 | } | 327 | } |
327 | 328 | ||
328 | if (r == SS_NO_UP_TO_DATE_DISK && | 329 | if (rv == SS_NO_UP_TO_DATE_DISK && |
329 | mdev->state.disk == D_CONSISTENT && mask.pdsk == 0) { | 330 | mdev->state.disk == D_CONSISTENT && mask.pdsk == 0) { |
330 | D_ASSERT(mdev->state.pdsk == D_UNKNOWN); | 331 | D_ASSERT(mdev->state.pdsk == D_UNKNOWN); |
331 | nps = drbd_try_outdate_peer(mdev); | 332 | nps = drbd_try_outdate_peer(mdev); |
@@ -341,9 +342,9 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
341 | continue; | 342 | continue; |
342 | } | 343 | } |
343 | 344 | ||
344 | if (r == SS_NOTHING_TO_DO) | 345 | if (rv == SS_NOTHING_TO_DO) |
345 | goto fail; | 346 | goto fail; |
346 | if (r == SS_PRIMARY_NOP && mask.pdsk == 0) { | 347 | if (rv == SS_PRIMARY_NOP && mask.pdsk == 0) { |
347 | nps = drbd_try_outdate_peer(mdev); | 348 | nps = drbd_try_outdate_peer(mdev); |
348 | 349 | ||
349 | if (force && nps > D_OUTDATED) { | 350 | if (force && nps > D_OUTDATED) { |
@@ -356,7 +357,7 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
356 | 357 | ||
357 | continue; | 358 | continue; |
358 | } | 359 | } |
359 | if (r == SS_TWO_PRIMARIES) { | 360 | if (rv == SS_TWO_PRIMARIES) { |
360 | /* Maybe the peer is detected as dead very soon... | 361 | /* Maybe the peer is detected as dead very soon... |
361 | retry at most once more in this case. */ | 362 | retry at most once more in this case. */ |
362 | __set_current_state(TASK_INTERRUPTIBLE); | 363 | __set_current_state(TASK_INTERRUPTIBLE); |
@@ -365,16 +366,16 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
365 | try = max_tries - 1; | 366 | try = max_tries - 1; |
366 | continue; | 367 | continue; |
367 | } | 368 | } |
368 | if (r < SS_SUCCESS) { | 369 | if (rv < SS_SUCCESS) { |
369 | r = _drbd_request_state(mdev, mask, val, | 370 | rv = _drbd_request_state(mdev, mask, val, |
370 | CS_VERBOSE + CS_WAIT_COMPLETE); | 371 | CS_VERBOSE + CS_WAIT_COMPLETE); |
371 | if (r < SS_SUCCESS) | 372 | if (rv < SS_SUCCESS) |
372 | goto fail; | 373 | goto fail; |
373 | } | 374 | } |
374 | break; | 375 | break; |
375 | } | 376 | } |
376 | 377 | ||
377 | if (r < SS_SUCCESS) | 378 | if (rv < SS_SUCCESS) |
378 | goto fail; | 379 | goto fail; |
379 | 380 | ||
380 | if (forced) | 381 | if (forced) |
@@ -423,7 +424,7 @@ int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
423 | kobject_uevent(&disk_to_dev(mdev->vdisk)->kobj, KOBJ_CHANGE); | 424 | kobject_uevent(&disk_to_dev(mdev->vdisk)->kobj, KOBJ_CHANGE); |
424 | fail: | 425 | fail: |
425 | mutex_unlock(&mdev->state_mutex); | 426 | mutex_unlock(&mdev->state_mutex); |
426 | return r; | 427 | return rv; |
427 | } | 428 | } |
428 | 429 | ||
429 | static struct drbd_conf *ensure_mdev(int minor, int create) | 430 | static struct drbd_conf *ensure_mdev(int minor, int create) |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index d34d093278c7..c116cbdc9dca 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3112,7 +3112,7 @@ static int receive_req_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsi | |||
3112 | { | 3112 | { |
3113 | struct p_req_state *p = &mdev->data.rbuf.req_state; | 3113 | struct p_req_state *p = &mdev->data.rbuf.req_state; |
3114 | union drbd_state mask, val; | 3114 | union drbd_state mask, val; |
3115 | int rv; | 3115 | enum drbd_state_rv rv; |
3116 | 3116 | ||
3117 | mask.i = be32_to_cpu(p->mask); | 3117 | mask.i = be32_to_cpu(p->mask); |
3118 | val.i = be32_to_cpu(p->val); | 3118 | val.i = be32_to_cpu(p->val); |