diff options
| -rw-r--r-- | drivers/block/drbd/drbd_int.h | 8 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_main.c | 32 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_nl.c | 32 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_proc.c | 2 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 12 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_state.c | 2 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_worker.c | 6 | ||||
| -rw-r--r-- | include/linux/drbd_genl.h | 4 |
8 files changed, 49 insertions, 49 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 | ||
| 168 | extern struct ratelimit_state drbd_ratelimit_state; | 168 | extern struct ratelimit_state drbd_ratelimit_state; |
| 169 | extern struct idr minors; /* RCU, updates: genl_lock() */ | 169 | extern struct idr drbd_devices; /* RCU, updates: genl_lock() */ |
| 170 | extern struct list_head drbd_connections; /* RCU, updates: genl_lock() */ | 170 | extern struct list_head drbd_connections; /* RCU, updates: genl_lock() */ |
| 171 | 171 | ||
| 172 | extern const char *cmdname(enum drbd_packet cmd); | 172 | extern const char *cmdname(enum drbd_packet cmd); |
| @@ -771,7 +771,7 @@ struct drbd_device { | |||
| 771 | 771 | ||
| 772 | static inline struct drbd_device *minor_to_device(unsigned int minor) | 772 | static 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 | ||
| 777 | static inline struct drbd_peer_device *first_peer_device(struct drbd_device *device) | 777 | static inline struct drbd_peer_device *first_peer_device(struct drbd_device *device) |
| @@ -1175,11 +1175,11 @@ extern rwlock_t global_state_lock; | |||
| 1175 | 1175 | ||
| 1176 | extern int conn_lowest_minor(struct drbd_connection *connection); | 1176 | extern int conn_lowest_minor(struct drbd_connection *connection); |
| 1177 | enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigned int minor, int vnr); | 1177 | enum drbd_ret_code drbd_create_minor(struct drbd_connection *connection, unsigned int minor, int vnr); |
| 1178 | extern void drbd_minor_destroy(struct kref *kref); | 1178 | extern void drbd_destroy_device(struct kref *kref); |
| 1179 | 1179 | ||
| 1180 | extern int set_resource_options(struct drbd_connection *connection, struct res_opts *res_opts); | 1180 | extern int set_resource_options(struct drbd_connection *connection, struct res_opts *res_opts); |
| 1181 | extern struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts); | 1181 | extern struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts); |
| 1182 | extern void conn_destroy(struct kref *kref); | 1182 | extern void drbd_destroy_connection(struct kref *kref); |
| 1183 | struct drbd_connection *conn_get_by_name(const char *name); | 1183 | struct drbd_connection *conn_get_by_name(const char *name); |
| 1184 | extern struct drbd_connection *conn_get_by_addrs(void *my_addr, int my_addr_len, | 1184 | extern 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 | */ |
| 120 | struct idr minors; | 120 | struct idr drbd_devices; |
| 121 | struct list_head drbd_connections; /* list of struct drbd_connection */ | 121 | struct list_head drbd_connections; /* list of struct drbd_connection */ |
| 122 | 122 | ||
| 123 | struct kmem_cache *drbd_request_cache; | 123 | struct 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. */ |
| 2161 | void drbd_minor_destroy(struct kref *kref) | 2161 | void 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 | ||
| 2579 | void conn_destroy(struct kref *kref) | 2579 | void 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 | |||
| 2725 | out_idr_remove_vol: | 2725 | out_idr_remove_vol: |
| 2726 | idr_remove(&connection->volumes, vnr_got); | 2726 | idr_remove(&connection->volumes, vnr_got); |
| 2727 | out_idr_remove_minor: | 2727 | out_idr_remove_minor: |
| 2728 | idr_remove(&minors, minor_got); | 2728 | idr_remove(&drbd_devices, minor_got); |
| 2729 | synchronize_rcu(); | 2729 | synchronize_rcu(); |
| 2730 | out_no_minor_idr: | 2730 | out_no_minor_idr: |
| 2731 | drbd_bm_cleanup(device); | 2731 | drbd_bm_cleanup(device); |
| @@ -2736,7 +2736,7 @@ out_no_io_page: | |||
| 2736 | out_no_disk: | 2736 | |
