diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 16 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 3 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 20 |
3 files changed, 11 insertions, 28 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 08259c101183..1aa29f8fdfe1 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c | |||
@@ -118,10 +118,10 @@ static void __bm_print_lock_info(struct drbd_device *device, const char *func) | |||
118 | struct drbd_bitmap *b = device->bitmap; | 118 | struct drbd_bitmap *b = device->bitmap; |
119 | if (!__ratelimit(&drbd_ratelimit_state)) | 119 | if (!__ratelimit(&drbd_ratelimit_state)) |
120 | return; | 120 | return; |
121 | drbd_err(device, "FIXME %s in %s, bitmap locked for '%s' by %s\n", | 121 | drbd_err(device, "FIXME %s[%d] in %s, bitmap locked for '%s' by %s[%d]\n", |
122 | drbd_task_to_thread_name(first_peer_device(device)->connection, current), | 122 | current->comm, task_pid_nr(current), |
123 | func, b->bm_why ?: "?", | 123 | func, b->bm_why ?: "?", |
124 | drbd_task_to_thread_name(first_peer_device(device)->connection, b->bm_task)); | 124 | b->bm_task->comm, task_pid_nr(b->bm_task)); |
125 | } | 125 | } |
126 | 126 | ||
127 | void drbd_bm_lock(struct drbd_device *device, char *why, enum bm_flag flags) | 127 | void drbd_bm_lock(struct drbd_device *device, char *why, enum bm_flag flags) |
@@ -137,10 +137,10 @@ void drbd_bm_lock(struct drbd_device *device, char *why, enum bm_flag flags) | |||
137 | trylock_failed = !mutex_trylock(&b->bm_change); | 137 | trylock_failed = !mutex_trylock(&b->bm_change); |
138 | 138 | ||
139 | if (trylock_failed) { | 139 | if (trylock_failed) { |
140 | drbd_warn(device, "%s going to '%s' but bitmap already locked for '%s' by %s\n", | 140 | drbd_warn(device, "%s[%d] going to '%s' but bitmap already locked for '%s' by %s[%d]\n", |
141 | drbd_task_to_thread_name(first_peer_device(device)->connection, current), | 141 | current->comm, task_pid_nr(current), |
142 | why, b->bm_why ?: "?", | 142 | why, b->bm_why ?: "?", |
143 | drbd_task_to_thread_name(first_peer_device(device)->connection, b->bm_task)); | 143 | b->bm_task->comm, task_pid_nr(b->bm_task)); |
144 | mutex_lock(&b->bm_change); | 144 | mutex_lock(&b->bm_change); |
145 | } | 145 | } |
146 | if (BM_LOCKED_MASK & b->bm_flags) | 146 | if (BM_LOCKED_MASK & b->bm_flags) |
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 1d78a09c4ca8..7293ea5ccabb 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -264,7 +264,7 @@ struct drbd_thread { | |||
264 | int (*function) (struct drbd_thread *); | 264 | int (*function) (struct drbd_thread *); |
265 | struct drbd_connection *connection; | 265 | struct drbd_connection *connection; |
266 | int reset_cpu_mask; | 266 | int reset_cpu_mask; |
267 | char name[9]; | 267 | const char *name; |
268 | }; | 268 | }; |
269 | 269 | ||
270 | static inline enum drbd_thread_state get_t_state(struct drbd_thread *thi) | 270 | static inline enum drbd_thread_state get_t_state(struct drbd_thread *thi) |
@@ -870,7 +870,6 @@ enum dds_flags { | |||
870 | extern void drbd_init_set_defaults(struct drbd_device *device); | 870 | extern void drbd_init_set_defaults(struct drbd_device *device); |
871 | extern int drbd_thread_start(struct drbd_thread *thi); | 871 | extern int drbd_thread_start(struct drbd_thread *thi); |
872 | extern void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait); | 872 | extern void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait); |
873 | extern char *drbd_task_to_thread_name(struct drbd_connection *connection, struct task_struct *task); | ||
874 | #ifdef CONFIG_SMP | 873 | #ifdef CONFIG_SMP |
875 | extern void drbd_thread_current_set_cpu(struct drbd_thread *thi); | 874 | extern void drbd_thread_current_set_cpu(struct drbd_thread *thi); |
876 | #else | 875 | #else |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 64a084c159ee..6c86807f22ec 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -368,14 +368,14 @@ restart: | |||
368 | } | 368 | } |
369 | 369 | ||
370 | static void drbd_thread_init(struct drbd_connection *connection, struct drbd_thread *thi, | 370 | static void drbd_thread_init(struct drbd_connection *connection, struct drbd_thread *thi, |
371 | int (*func) (struct drbd_thread *), char *name) | 371 | int (*func) (struct drbd_thread *), const char *name) |
372 | { | 372 | { |
373 | spin_lock_init(&thi->t_lock); | 373 | spin_lock_init(&thi->t_lock); |
374 | thi->task = NULL; | 374 | thi->task = NULL; |
375 | thi->t_state = NONE; | 375 | thi->t_state = NONE; |
376 | thi->function = func; | 376 | thi->function = func; |
377 | thi->connection = connection; | 377 | thi->connection = connection; |
378 | strncpy(thi->name, name, ARRAY_SIZE(thi->name)); | 378 | thi->name = name; |
379 | } | 379 | } |
380 | 380 | ||
381 | int drbd_thread_start(struct drbd_thread *thi) | 381 | int drbd_thread_start(struct drbd_thread *thi) |
@@ -475,22 +475,6 @@ void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait) | |||
475 | wait_for_completion(&thi->stop); | 475 | wait_for_completion(&thi->stop); |
476 | } | 476 | } |
477 | 477 | ||
478 | static struct drbd_thread *drbd_task_to_thread(struct drbd_connection *connection, struct task_struct *task) | ||
479 | { | ||
480 | struct drbd_thread *thi = | ||
481 | task == connection->receiver.task ? &connection->receiver : | ||
482 | task == connection->asender.task ? &connection->asender : | ||
483 | task == connection->worker.task ? &connection->worker : NULL; | ||
484 | |||
485 | return thi; | ||
486 | } | ||
487 | |||
488 | char *drbd_task_to_thread_name(struct drbd_connection *connection, struct task_struct *task) | ||
489 | { | ||
490 | struct drbd_thread *thi = drbd_task_to_thread(connection, task); | ||
491 | return thi ? thi->name : task->comm; | ||
492 | } | ||
493 | |||
494 | int conn_lowest_minor(struct drbd_connection *connection) | 478 | int conn_lowest_minor(struct drbd_connection *connection) |
495 | { | 479 | { |
496 | struct drbd_peer_device *peer_device; | 480 | struct drbd_peer_device *peer_device; |