aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-06-07 16:54:17 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2014-02-17 10:44:52 -0500
commit05a10ec7900dbdba008a24bf56b3490c4b568d2c (patch)
treef89e7b2e71a15e1b41dae481ac6b3366c115d21e /drivers/block/drbd
parenta6b32bc3cebd3fb6848c526763733b9dbc389c02 (diff)
drbd: Improve some function and variable naming
Rename functions conn_destroy() -> drbd_destroy_connection(), drbd_minor_destroy() -> drbd_destroy_device() drbd_adm_add_minor() -> drbd_adm_add_minor() drbd_adm_delete_minor() -> drbd_adm_del_minor() Rename global variable minors to drbd_devices 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.h8
-rw-r--r--drivers/block/drbd/drbd_main.c32
-rw-r--r--drivers/block/drbd/drbd_nl.c32
-rw-r--r--drivers/block/drbd/drbd_proc.c2
-rw-r--r--drivers/block/drbd/drbd_receiver.c12
-rw-r--r--drivers/block/drbd/drbd_state.c2
-rw-r--r--drivers/block/drbd/drbd_worker.c6
7 files changed, 47 insertions, 47 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 85e2f4b56a06..b324314768fd 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -166,7 +166,7 @@ drbd_insert_fault(struct drbd_device *device, unsigned int type) {
166#define div_floor(A, B) ((A)/(B)) 166#define div_floor(A, B) ((A)/(B))
167 167
168extern struct ratelimit_state drbd_ratelimit_state; 168extern struct ratelimit_state drbd_ratelimit_state;
169extern struct idr minors; /* RCU, updates: genl_lock() */ 169extern struct idr drbd_devices; /* RCU, updates: genl_lock() */
170extern struct list_head drbd_connections; /* RCU, updates: genl_lock() */ 170extern struct list_head drbd_connections; /* RCU, updates: genl_lock() */
171 171
172extern const char *cmdname(enum drbd_packet cmd); 172extern const char *cmdname(enum drbd_packet cmd);
@@ -771,7 +771,7 @@ struct drbd_device {
771 771
772static inline struct drbd_device *minor_to_device(unsigned int minor) 772static inline struct drbd_device *minor_to_device(unsigned int minor)
773{ 773{
774 return (struct drbd_device *)idr_find(&minors, minor); 774 return (struct drbd_device *)idr_find(&drbd_devices, minor);
775} 775}
776 776
777static inline struct drbd_peer_device *first_peer_device(struct drbd_device *device) 777static inline struct drbd_peer_device *first_peer_device(struct drbd_device *device)
@@ -1175,11 +1175,11 @@ extern rwlock_t global_state_lock;
1175 1175
1176extern int conn_lowest_minor(struct drbd_connection *connection); 1176extern int conn_lowest_minor(struct drbd_connection *connection);
1177enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigned int minor, int vnr); 1177enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigned int minor, int vnr);
1178extern void drbd_minor_destroy(struct kref *kref); 1178extern void drbd_destroy_device(struct kref *kref);
1179 1179
1180extern int set_resource_options(struct drbd_connection *connection, struct res_opts *res_opts); 1180extern int set_resource_options(struct drbd_connection *connection, struct res_opts *res_opts);
1181extern struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts); 1181extern struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts);
1182extern void conn_destroy(struct kref *kref); 1182extern void drbd_destroy_connection(struct kref *kref);
1183struct drbd_connection *conn_get_by_name(const char *name); 1183struct drbd_connection *conn_get_by_name(const char *name);
1184extern struct drbd_connection *conn_get_by_addrs(void *my_addr, int my_addr_len, 1184extern struct drbd_connection *conn_get_by_addrs(void *my_addr, int my_addr_len,
1185 void *peer_addr, int peer_addr_len); 1185 void *peer_addr, int peer_addr_len);
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index b7c858f51fa6..4da017d22f4b 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -117,7 +117,7 @@ module_param_string(usermode_helper, usermode_helper, sizeof(usermode_helper), 0
117/* in 2.6.x, our device mapping and config info contains our virtual gendisks 117/* in 2.6.x, our device mapping and config info contains our virtual gendisks
118 * as member "struct gendisk *vdisk;" 118 * as member "struct gendisk *vdisk;"
119 */ 119 */
120struct idr minors; 120struct idr drbd_devices;
121struct list_head drbd_connections; /* list of struct drbd_connection */ 121struct list_head drbd_connections; /* list of struct drbd_connection */
122 122
123struct kmem_cache *drbd_request_cache; 123struct kmem_cache *drbd_request_cache;
@@ -364,7 +364,7 @@ restart:
364 364
365 /* Release mod reference taken when thread was started */ 365 /* Release mod reference taken when thread was started */
366 366
367 kref_put(&connection->kref, &conn_destroy); 367 kref_put(&connection->kref, drbd_destroy_connection);
368 module_put(THIS_MODULE); 368 module_put(THIS_MODULE);
369 return retval; 369 return retval;
370} 370}
@@ -416,7 +416,7 @@ int drbd_thread_start(struct drbd_thread *thi)
416 if (IS_ERR(nt)) { 416 if (IS_ERR(nt)) {
417 conn_err(connection, "Couldn't start thread\n"); 417 conn_err(connection, "Couldn't start thread\n");
418 418
419 kref_put(&connection->kref, &conn_destroy); 419 kref_put(&connection->kref, drbd_destroy_connection);
420 module_put(THIS_MODULE); 420 module_put(THIS_MODULE);
421 return false; 421 return false;
422 } 422 }
@@ -2158,7 +2158,7 @@ static void drbd_release_all_peer_reqs(struct drbd_device *device)
2158} 2158}
2159 2159
2160/* caution. no locking. */ 2160/* caution. no locking. */
2161void drbd_minor_destroy(struct kref *kref) 2161void drbd_destroy_device(struct kref *kref)
2162{ 2162{
2163 struct drbd_device *device = container_of(kref, struct drbd_device, kref); 2163 struct drbd_device *device = container_of(kref, struct drbd_device, kref);
2164 struct drbd_connection *connection = first_peer_device(device)->connection; 2164 struct drbd_connection *connection = first_peer_device(device)->connection;
@@ -2195,7 +2195,7 @@ void drbd_minor_destroy(struct kref *kref)
2195 kfree(first_peer_device(device)); 2195 kfree(first_peer_device(device));
2196 kfree(device); 2196 kfree(device);
2197 2197
2198 kref_put(&connection->kref, &conn_destroy); 2198 kref_put(&connection->kref, drbd_destroy_connection);
2199} 2199}
2200 2200
2201/* One global retry thread, if we need to push back some bio and have it 2201/* One global retry thread, if we need to push back some bio and have it
@@ -2301,26 +2301,26 @@ static void drbd_cleanup(void)
2301 2301
2302 drbd_genl_unregister(); 2302 drbd_genl_unregister();
2303 2303
2304 idr_for_each_entry(&minors, device, i) { 2304 idr_for_each_entry(&drbd_devices, device, i) {
2305 idr_remove(&minors, device_to_minor(device)); 2305 idr_remove(&drbd_devices, device_to_minor(device));
2306 idr_remove(&first_peer_device(device)->connection->volumes, device->vnr); 2306 idr_remove(&first_peer_device(device)->connection->volumes, device->vnr);
2307 destroy_workqueue(device->submit.wq); 2307 destroy_workqueue(device->submit.wq);
2308 del_gendisk(device->vdisk); 2308 del_gendisk(device->vdisk);
2309 /* synchronize_rcu(); No other threads running at this point */ 2309 /* synchronize_rcu(); No other threads running at this point */
2310 kref_put(&device->kref, &drbd_minor_destroy); 2310 kref_put(&device->kref, drbd_destroy_device);
2311 } 2311 }
2312 2312
2313 /* not _rcu since, no other updater anymore. Genl already unregistered */ 2313 /* not _rcu since, no other updater anymore. Genl already unregistered */
2314 list_for_each_entry_safe(connection, tmp, &drbd_connections, connections) { 2314 list_for_each_entry_safe(connection, tmp, &drbd_connections, connections) {
2315 list_del(&connection->connections); /* not _rcu no proc, not other threads */ 2315 list_del(&connection->connections); /* not _rcu no proc, not other threads */
2316 /* synchronize_rcu(); */ 2316 /* synchronize_rcu(); */
2317 kref_put(&connection->kref, &conn_destroy); 2317 kref_put(&connection->kref, drbd_destroy_connection);
2318 } 2318 }
2319 2319
2320 drbd_destroy_mempools(); 2320 drbd_destroy_mempools();
2321 unregister_blkdev(DRBD_MAJOR, "drbd"); 2321 unregister_blkdev(DRBD_MAJOR, "drbd");
2322 2322
2323 idr_destroy(&minors); 2323 idr_destroy(&drbd_devices);
2324 2324
2325 printk(KERN_INFO "drbd: module cleanup done.\n"); 2325 printk(KERN_INFO "drbd: module cleanup done.\n");
2326} 2326}
@@ -2576,7 +2576,7 @@ fail:
2576 return NULL; 2576 return NULL;
2577} 2577}
2578 2578
2579void conn_destroy(struct kref *kref) 2579void drbd_destroy_connection(struct kref *kref)
2580{ 2580{
2581 struct drbd_connection *connection = container_of(kref, struct drbd_connection, kref); 2581 struct drbd_connection *connection = container_of(kref, struct drbd_connection, kref);
2582 2582
@@ -2688,7 +2688,7 @@ enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigne
2688 device->read_requests = RB_ROOT; 2688 device->read_requests = RB_ROOT;
2689 device->write_requests = RB_ROOT; 2689 device->write_requests = RB_ROOT;
2690 2690
2691 minor_got = idr_alloc(&minors, device, minor, minor + 1, GFP_KERNEL); 2691 minor_got = idr_alloc(&drbd_devices, device, minor, minor + 1, GFP_KERNEL);
2692 if (minor_got < 0) { 2692 if (minor_got < 0) {
2693 if (minor_got == -ENOSPC) { 2693 if (minor_got == -ENOSPC) {
2694 err = ERR_MINOR_EXISTS; 2694 err = ERR_MINOR_EXISTS;
@@ -2725,7 +2725,7 @@ enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigne
2725out_idr_remove_vol: 2725out_idr_remove_vol:
2726 idr_remove(&connection->volumes, vnr_got); 2726 idr_remove(&connection->volumes, vnr_got);
2727out_idr_remove_minor: 2727out_idr_remove_minor:
2728 idr_remove(&minors, minor_got); 2728 idr_remove(&drbd_devices, minor_got);
2729 synchronize_rcu(); 2729 synchronize_rcu();
2730out_no_minor_idr: 2730out_no_minor_idr:
2731 drbd_bm_cleanup(device); 2731 drbd_bm_cleanup(device);
@@ -2736,7 +2736,7 @@ out_no_io_page:
2736out_no_disk: 2736out_no_disk:
2737 blk_cleanup_queue(q); 2737 blk_cleanup_queue(q);
2738out_no_q: 2738out_no_q:
2739 kref_put(&connection->kref, &conn_destroy); 2739 kref_put(&connection->kref, drbd_destroy_connection);
2740out_no_peer_device: 2740out_no_peer_device:
2741 kfree(device); 2741 kfree(device);
2742 return err; 2742 return err;
@@ -2772,7 +2772,7 @@ int __init drbd_init(void)
2772 init_waitqueue_head(&drbd_pp_wait); 2772 init_waitqueue_head(&drbd_pp_wait);
2773 2773
2774 drbd_proc = NULL; /* play safe for drbd_cleanup */ 2774 drbd_proc = NULL; /* play safe for drbd_cleanup */
2775 idr_init(&minors); 2775 idr_init(&drbd_devices);
2776 2776
2777 rwlock_init(&global_state_lock); 2777 rwlock_init(&global_state_lock);
2778 INIT_LIST_HEAD(&drbd_connections); 2778 INIT_LIST_HEAD(&drbd_connections);
@@ -2863,7 +2863,7 @@ void conn_md_sync(struct drbd_connection *connection)
2863 kref_get(&device->kref); 2863 kref_get(&device->kref);
2864 rcu_read_unlock(); 2864 rcu_read_unlock();
2865 drbd_md_sync(device); 2865 drbd_md_sync(device);
2866 kref_put(&device->kref, &drbd_minor_destroy); 2866 kref_put(&device->kref, drbd_destroy_device);
2867 rcu_read_lock(); 2867 rcu_read_lock();
2868 } 2868 }
2869 rcu_read_unlock(); 2869 rcu_read_unlock();
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index a8c9c86e29f5..83d8c18fb84c 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -45,8 +45,8 @@
45// int drbd_adm_create_resource(struct sk_buff *skb, struct genl_info *info); 45// int drbd_adm_create_resource(struct sk_buff *skb, struct genl_info *info);
46// int drbd_adm_delete_resource(struct sk_buff *skb, struct genl_info *info); 46// int drbd_adm_delete_resource(struct sk_buff *skb, struct genl_info *info);
47 47
48int drbd_adm_add_minor(struct sk_buff *skb, struct genl_info *info); 48int drbd_adm_new_minor(struct sk_buff *skb, struct genl_info *info);
49int drbd_adm_delete_minor(struct sk_buff *skb, struct genl_info *info); 49int drbd_adm_del_minor(struct sk_buff *skb, struct genl_info *info);
50 50
51int drbd_adm_new_resource(struct sk_buff *skb, struct genl_info *info); 51int drbd_adm_new_resource(struct sk_buff *skb, struct genl_info *info);
52int drbd_adm_del_resource(struct sk_buff *skb, struct genl_info *info); 52int drbd_adm_del_resource(struct sk_buff *skb, struct genl_info *info);
@@ -274,7 +274,7 @@ fail:
274static int drbd_adm_finish(struct genl_info *info, int retcode) 274static int drbd_adm_finish(struct genl_info *info, int retcode)
275{ 275{
276 if (adm_ctx.connection) { 276 if (adm_ctx.connection) {
277 kref_put(&adm_ctx.connection->kref, &conn_destroy); 277 kref_put(&adm_ctx.connection->kref, drbd_destroy_connection);
278 adm_ctx.connection = NULL; 278 adm_ctx.connection = NULL;
279 } 279 }
280 280
@@ -517,7 +517,7 @@ static int _try_outdate_peer_async(void *data)
517 517
518 conn_try_outdate_peer(connection); 518 conn_try_outdate_peer(connection);
519 519
520 kref_put(&connection->kref, &conn_destroy); 520 kref_put(&connection->kref, drbd_destroy_connection);
521 return 0; 521 return 0;
522} 522}
523 523
@@ -529,7 +529,7 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection)
529 opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); 529 opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h");
530 if (IS_ERR(opa)) { 530 if (IS_ERR(opa)) {
531 conn_err(connection, "out of mem, failed to invoke fence-peer helper\n"); 531 conn_err(connection, "out of mem, failed to invoke fence-peer helper\n");
532 kref_put(&connection->kref, &conn_destroy); 532 kref_put(&connection->kref, drbd_destroy_connection);
533 } 533 }
534} 534}
535 535
@@ -2924,7 +2924,7 @@ static int get_one_status(struct sk_buff *skb, struct netlink_callback *cb)
2924 * on each iteration. 2924 * on each iteration.
2925 */ 2925 */
2926 2926
2927 /* synchronize with conn_create()/conn_destroy() */ 2927 /* synchronize with conn_create()/drbd_destroy_connection() */
2928 rcu_read_lock(); 2928 rcu_read_lock();
2929 /* revalidate iterator position */ 2929 /* revalidate iterator position */
2930 list_for_each_entry_rcu(tmp, &drbd_connections, connections) { 2930 list_for_each_entry_rcu(tmp, &drbd_connections, connections) {
@@ -3056,7 +3056,7 @@ int drbd_adm_get_status_all(struct sk_buff *skb, struct netlink_callback *cb)
3056 if (!connection) 3056 if (!connection)
3057 return -ENODEV; 3057 return -ENODEV;
3058 3058
3059 kref_put(&connection->kref, &conn_destroy); /* get_one_status() (re)validates connection by itself */ 3059 kref_put(&connection->kref, drbd_destroy_connection); /* get_one_status() (re)validates connection by itself */
3060 3060
3061 /* prime iterators, and set "filter" mode mark: 3061 /* prime iterators, and set "filter" mode mark:
3062 * only dump this connection. */ 3062 * only dump this connection. */
@@ -3266,7 +3266,7 @@ out:
3266 return 0; 3266 return 0;
3267} 3267}
3268 3268
3269int drbd_adm_add_minor(struct sk_buff *skb, struct genl_info *info) 3269int drbd_adm_new_minor(struct sk_buff *skb, struct genl_info *info)
3270{ 3270{
3271 struct drbd_genlmsghdr *dh = info->userhdr; 3271 struct drbd_genlmsghdr *dh = info->userhdr;
3272 enum drbd_ret_code retcode; 3272 enum drbd_ret_code retcode;
@@ -3303,7 +3303,7 @@ out:
3303 return 0; 3303 return 0;
3304} 3304}
3305 3305
3306static enum drbd_ret_code adm_delete_minor(struct drbd_device *device) 3306static enum drbd_ret_code adm_del_minor(struct drbd_device *device)
3307{ 3307{
3308 if (device->state.disk == D_DISKLESS && 3308 if (device->state.disk == D_DISKLESS &&
3309 /* no need to be device->state.conn == C_STANDALONE && 3309 /* no need to be device->state.conn == C_STANDALONE &&
@@ -3313,17 +3313,17 @@ static enum drbd_ret_code adm_delete_minor(struct drbd_device *device)
3313 _drbd_request_state(device, NS(conn, C_WF_REPORT_PARAMS), 3313 _drbd_request_state(device, NS(conn, C_WF_REPORT_PARAMS),
3314 CS_VERBOSE + CS_WAIT_COMPLETE); 3314 CS_VERBOSE + CS_WAIT_COMPLETE);
3315 idr_remove(&first_peer_device(device)->connection->volumes, device->vnr); 3315 idr_remove(&first_peer_device(device)->connection->volumes, device->vnr);
3316 idr_remove(&minors, device_to_minor(device)); 3316 idr_remove(&drbd_devices, device_to_minor(device));
3317 destroy_workqueue(device->submit.wq); 3317 destroy_workqueue(device->submit.wq);
3318 del_gendisk(device->vdisk); 3318 del_gendisk(device->vdisk);
3319 synchronize_rcu(); 3319 synchronize_rcu();
3320 kref_put(&device->kref, &drbd_minor_destroy); 3320 kref_put(&device->kref, drbd_destroy_device);
3321 return NO_ERROR; 3321 return NO_ERROR;
3322 } else 3322 } else
3323 return ERR_MINOR_CONFIGURED; 3323 return ERR_MINOR_CONFIGURED;
3324} 3324}
3325 3325
3326int drbd_adm_delete_minor(struct sk_buff *skb, struct genl_info *info) 3326int drbd_adm_del_minor(struct sk_buff *skb, struct genl_info *info)
3327{ 3327{
3328 enum drbd_ret_code retcode; 3328 enum drbd_ret_code retcode;
3329 3329
@@ -3333,7 +3333,7 @@ int drbd_adm_delete_minor(struct sk_buff *skb, struct genl_info *info)
3333 if (retcode != NO_ERROR) 3333 if (retcode != NO_ERROR)
3334 goto out; 3334 goto out;
3335 3335
3336 retcode = adm_delete_minor(adm_ctx.device); 3336 retcode = adm_del_minor(adm_ctx.device);
3337out: 3337out:
3338 drbd_adm_finish(info, retcode); 3338 drbd_adm_finish(info, retcode);
3339 return 0; 3339 return 0;
@@ -3389,7 +3389,7 @@ int drbd_adm_down(struct sk_buff *skb, struct genl_info *info)
3389 3389
3390 /* delete volumes */ 3390 /* delete volumes */
3391 idr_for_each_entry(&adm_ctx.connection->volumes, device, i) { 3391 idr_for_each_entry(&adm_ctx.connection->volumes, device, i) {
3392 retcode = adm_delete_minor(device); 3392 retcode = adm_del_minor(device);
3393 if (retcode != NO_ERROR) { 3393 if (retcode != NO_ERROR) {
3394 /* "can not happen" */ 3394 /* "can not happen" */
3395 drbd_msg_put_info("failed to delete volume"); 3395 drbd_msg_put_info("failed to delete volume");
@@ -3401,7 +3401,7 @@ int drbd_adm_down(struct sk_buff *skb, struct genl_info *info)
3401 if (conn_lowest_minor(adm_ctx.connection) < 0) { 3401 if (conn_lowest_minor(adm_ctx.connection) < 0) {
3402 list_del_rcu(&adm_ctx.connection->connections); 3402 list_del_rcu(&adm_ctx.connection->connections);
3403 synchronize_rcu(); 3403 synchronize_rcu();
3404 kref_put(&adm_ctx.connection->kref, &conn_destroy); 3404 kref_put(&adm_ctx.connection->kref, drbd_destroy_connection);
3405 3405
3406 retcode = NO_ERROR; 3406 retcode = NO_ERROR;
3407 } else { 3407 } else {
@@ -3428,7 +3428,7 @@ int drbd_adm_del_resource(struct sk_buff *skb, struct genl_info *info)
3428 if (conn_lowest_minor(adm_ctx.connection) < 0) { 3428 if (conn_lowest_minor(adm_ctx.connection) < 0) {
3429 list_del_rcu(&adm_ctx.connection->connections); 3429 list_del_rcu(&adm_ctx.connection->connections);
3430 synchronize_rcu(); 3430 synchronize_rcu();
3431 kref_put(&adm_ctx.connection->kref, &conn_destroy); 3431 kref_put(&adm_ctx.connection->kref, drbd_destroy_connection);
3432 3432
3433 retcode = NO_ERROR; 3433 retcode = NO_ERROR;
3434 } else { 3434 } else {
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c
index f1c81c101fad..2f26e8ffa45b 100644
--- a/drivers/block/drbd/drbd_proc.c
+++ b/drivers/block/drbd/drbd_proc.c
@@ -236,7 +236,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
236 */ 236 */
237 237
238 rcu_read_lock(); 238 rcu_read_lock();
239 idr_for_each_entry(&minors, device, i) { 239 idr_for_each_entry(&drbd_devices, device, i) {
240 if (prev_i != i - 1) 240 if (prev_i != i - 1)
241 seq_printf(seq, "\n"); 241 seq_printf(seq, "\n");
242 prev_i = i; 242 prev_i = i;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index e08e99f756a5..791005e163db 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1058,7 +1058,7 @@ randomize:
1058 clear_bit(DISCARD_MY_DATA, &device->flags); 1058 clear_bit(DISCARD_MY_DATA, &device->flags);
1059 1059
1060 drbd_connected(device); 1060 drbd_connected(device);
1061 kref_put(&device->kref, &drbd_minor_destroy); 1061 kref_put(&device->kref, drbd_destroy_device);
1062 rcu_read_lock(); 1062 rcu_read_lock();
1063 } 1063 }
1064 rcu_read_unlock(); 1064 rcu_read_unlock();
@@ -1166,7 +1166,7 @@ static void drbd_flush(struct drbd_connection *connection)
1166 drbd_bump_write_ordering(connection, WO_drain_io); 1166 drbd_bump_write_ordering(connection, WO_drain_io);
1167 } 1167 }
1168 put_ldev(device); 1168 put_ldev(device);
1169 kref_put(&device->kref, &drbd_minor_destroy); 1169 kref_put(&device->kref, drbd_destroy_device);
1170 1170
1171 rcu_read_lock(); 1171 rcu_read_lock();
1172 if (rv) 1172 if (rv)
@@ -1409,7 +1409,7 @@ static void conn_wait_active_ee_empty(struct drbd_connection *connection)
1409 kref_get(&device->kref); 1409 kref_get(&device->kref);
1410 rcu_read_unlock(); 1410 rcu_read_unlock();
1411 drbd_wait_ee_list_empty(device, &device->active_ee); 1411 drbd_wait_ee_list_empty(device, &device->active_ee);
1412 kref_put(&device->kref, &drbd_minor_destroy); 1412 kref_put(&device->kref, drbd_destroy_device);
1413 rcu_read_lock(); 1413 rcu_read_lock();
1414 } 1414 }
1415 rcu_read_unlock(); 1415 rcu_read_unlock();
@@ -4459,7 +4459,7 @@ static void conn_disconnect(struct drbd_connection *connection)
4459 kref_get(&device->kref); 4459 kref_get(&device->kref);
4460 rcu_read_unlock(); 4460 rcu_read_unlock();
4461 drbd_disconnected(device); 4461 drbd_disconnected(device);
4462 kref_put(&device->kref, &drbd_minor_destroy); 4462 kref_put(&device->kref, &drbd_destroy_device);
4463 rcu_read_lock(); 4463 rcu_read_lock();
4464 } 4464 }
4465 rcu_read_unlock(); 4465 rcu_read_unlock();
@@ -5199,10 +5199,10 @@ static int connection_finish_peer_reqs(struct drbd_connection *connection)
5199 kref_get(&device->kref); 5199 kref_get(&device->kref);
5200 rcu_read_unlock(); 5200 rcu_read_unlock();
5201 if (drbd_finish_peer_reqs(device)) { 5201 if (drbd_finish_peer_reqs(device)) {
5202 kref_put(&device->kref, &drbd_minor_destroy); 5202 kref_put(&device->kref, drbd_destroy_device);
5203 return 1; 5203 return 1;
5204 } 5204 }
5205 kref_put(&device->kref, &drbd_minor_destroy); 5205 kref_put(&device->kref, drbd_destroy_device);
5206 rcu_read_lock(); 5206 rcu_read_lock();
5207 } 5207 }
5208 set_bit(SIGNAL_ASENDER, &connection->flags); 5208 set_bit(SIGNAL_ASENDER, &connection->flags);
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 22c4e7d57a80..bb3d5947904d 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1574,7 +1574,7 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
1574 spin_unlock_irq(&connection->req_lock); 1574 spin_unlock_irq(&connection->req_lock);
1575 } 1575 }
1576 } 1576 }
1577 kref_put(&connection->kref, &conn_destroy); 1577 kref_put(&connection->kref, drbd_destroy_connection);
1578 1578
1579 conn_md_sync(connection); 1579 conn_md_sync(connection);
1580 1580
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index aa1ad7f39786..378e48c983b3 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1458,7 +1458,7 @@ static int _drbd_pause_after(struct drbd_device *device)
1458 int i, rv = 0; 1458 int i, rv = 0;
1459 1459
1460 rcu_read_lock(); 1460 rcu_read_lock();
1461 idr_for_each_entry(&minors, odev, i) { 1461 idr_for_each_entry(&drbd_devices, odev, i) {
1462 if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS) 1462 if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS)
1463 continue; 1463 continue;
1464 if (!_drbd_may_sync_now(odev)) 1464 if (!_drbd_may_sync_now(odev))
@@ -1482,7 +1482,7 @@ static int _drbd_resume_next(struct drbd_device *device)
1482 int i, rv = 0; 1482 int i, rv = 0;
1483 1483
1484 rcu_read_lock(); 1484 rcu_read_lock();
1485 idr_for_each_entry(&minors, odev, i) { 1485 idr_for_each_entry(&drbd_devices, odev, i) {
1486 if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS) 1486 if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS)
1487 continue; 1487 continue;
1488 if (odev->state.aftr_isp) { 1488 if (odev->state.aftr_isp) {
@@ -1939,7 +1939,7 @@ int drbd_worker(struct drbd_thread *thi)
1939 kref_get(&device->kref); 1939 kref_get(&device->kref);
1940 rcu_read_unlock(); 1940 rcu_read_unlock();
1941 drbd_device_cleanup(device); 1941 drbd_device_cleanup(device);
1942 kref_put(&device->kref, &drbd_minor_destroy); 1942 kref_put(&device->kref, drbd_destroy_device);
1943 rcu_read_lock(); 1943 rcu_read_lock();
1944 } 1944 }
1945 rcu_read_unlock(); 1945 rcu_read_unlock();