drbd: Consolidated the setup of the thread name into the framework
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 8 Feb 2011 14:35:58 +0000 (15:35 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Wed, 28 Sep 2011 08:33:09 +0000 (10:33 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c

index e89ec80395d3ad3ac31c23630e52c6edb6fe5981..0861746a747532dd29f5aac98cac88c859b8728f 100644 (file)
@@ -446,6 +446,9 @@ static int drbd_thread_setup(void *arg)
        unsigned long flags;
        int retval;
 
+       snprintf(current->comm, sizeof(current->comm), "drbd_%c_%s",
+                thi->name[0], thi->mdev->tconn->name);
+
 restart:
        retval = thi->function(thi);
 
index 4aa75bad16cd627ad0ab6a9fd5e11d996d21b768..ab9b505c0f0bc4a230233c9692f8d13f2bdd18be 100644 (file)
@@ -4227,11 +4227,8 @@ static int drbd_do_auth(struct drbd_tconn *tconn)
 int drbdd_init(struct drbd_thread *thi)
 {
        struct drbd_conf *mdev = thi->mdev;
-       unsigned int minor = mdev_to_minor(mdev);
        int h;
 
-       sprintf(current->comm, "drbd%d_receiver", minor);
-
        dev_info(DEV, "receiver (re)started\n");
 
        do {
@@ -4572,8 +4569,6 @@ int drbd_asender(struct drbd_thread *thi)
        int ping_timeout_active = 0;
        int empty;
 
-       sprintf(current->comm, "drbd%d_asender", mdev_to_minor(mdev));
-
        current->policy = SCHED_RR;  /* Make this a realtime task! */
        current->rt_priority = 2;    /* more important than all other tasks */
 
index cac65f67c1449b0cafd03a913c0d7b515714498a..6f709621ae268da1286978d10e87da1d039cdbd0 100644 (file)
@@ -1631,8 +1631,6 @@ int drbd_worker(struct drbd_thread *thi)
        LIST_HEAD(work_list);
        int intr = 0, i;
 
-       sprintf(current->comm, "drbd%d_worker", mdev_to_minor(mdev));
-
        while (get_t_state(thi) == RUNNING) {
                drbd_thread_current_set_cpu(thi);
 
This page took 0.031751 seconds and 5 git commands to generate.