Commit f8015734 authored by Neil Brown's avatar Neil Brown Committed by James Bottomley

[PATCH] Add name of md device to name of thread managing that device.

This allows the thread to easily identified and signalled.
The point of signalling will appear in the next patch.
parent 0b8838ab
...@@ -1184,9 +1184,9 @@ static int run(mddev_t *mddev) ...@@ -1184,9 +1184,9 @@ static int run(mddev_t *mddev)
{ {
const char * name = "raid1d"; snprintf(conf->thread_name,MD_THREAD_NAME_MAX,"raid1d_md%d",mdidx(mddev));
conf->thread = md_register_thread(raid1d, conf, name); conf->thread = md_register_thread(raid1d, conf, conf->thread_name);
if (!conf->thread) { if (!conf->thread) {
printk(THREAD_ERROR, mdidx(mddev)); printk(THREAD_ERROR, mdidx(mddev));
goto out_free_conf; goto out_free_conf;
......
...@@ -1477,9 +1477,9 @@ static int run (mddev_t *mddev) ...@@ -1477,9 +1477,9 @@ static int run (mddev_t *mddev)
} }
{ {
const char * name = "raid5d"; snprintf(conf->thread_name,MD_THREAD_NAME_MAX,"raid5d_md%d",mdidx(mddev));
conf->thread = md_register_thread(raid5d, conf, name); conf->thread = md_register_thread(raid5d, conf, conf->thread_name);
if (!conf->thread) { if (!conf->thread) {
printk(KERN_ERR "raid5: couldn't allocate thread for md%d\n", mdidx(mddev)); printk(KERN_ERR "raid5: couldn't allocate thread for md%d\n", mdidx(mddev));
goto abort; goto abort;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define LEVEL_LINEAR (-1) #define LEVEL_LINEAR (-1)
#define MaxSector (~(sector_t)0) #define MaxSector (~(sector_t)0)
#define MD_THREAD_NAME_MAX 14
static inline int pers_to_level (int pers) static inline int pers_to_level (int pers)
{ {
......
...@@ -34,6 +34,7 @@ struct r1_private_data_s { ...@@ -34,6 +34,7 @@ struct r1_private_data_s {
mempool_t *r1bio_pool; mempool_t *r1bio_pool;
mempool_t *r1buf_pool; mempool_t *r1buf_pool;
char thread_name[MD_THREAD_NAME_MAX];
}; };
typedef struct r1_private_data_s conf_t; typedef struct r1_private_data_s conf_t;
......
...@@ -226,6 +226,7 @@ struct raid5_private_data { ...@@ -226,6 +226,7 @@ struct raid5_private_data {
* waiting for 25% to be free * waiting for 25% to be free
*/ */
spinlock_t device_lock; spinlock_t device_lock;
char thread_name[MD_THREAD_NAME_MAX];
}; };
typedef struct raid5_private_data raid5_conf_t; typedef struct raid5_private_data raid5_conf_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment