]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drbd: use resource name in workqueue
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 24 Mar 2015 09:40:26 +0000 (10:40 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:02 +0000 (09:22 -0700)
Since kernel 3.3, we can use snprintf-style arguments
to create a workqueue.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_receiver.c

index 938bca2df027fc6f971b80aff350a4f507cd7a62..3a9a0f11200426771d0c9bffe77d6cc4a4f54c9c 100644 (file)
@@ -2694,8 +2694,8 @@ static int init_submitter(struct drbd_device *device)
 {
        /* opencoded create_singlethread_workqueue(),
         * to be able to say "drbd%d", ..., minor */
-       device->submit.wq = alloc_workqueue("drbd%u_submit",
-                       WQ_UNBOUND | WQ_MEM_RECLAIM, 1, device->minor);
+       device->submit.wq =
+               alloc_ordered_workqueue("drbd%u_submit", WQ_MEM_RECLAIM, device->minor);
        if (!device->submit.wq)
                return -ENOMEM;
 
index ea54341df3bffa7a7c629a9f83af0da1ddddd288..1957fe8601dcbb60ee2b8d3aa9367104fd503daf 100644 (file)
@@ -1124,7 +1124,10 @@ randomize:
        }
 
        drbd_thread_start(&connection->ack_receiver);
-       connection->ack_sender = create_singlethread_workqueue("drbd_ack_sender");
+       /* opencoded create_singlethread_workqueue(),
+        * to be able to use format string arguments */
+       connection->ack_sender =
+               alloc_ordered_workqueue("drbd_as_%s", WQ_MEM_RECLAIM, connection->resource->name);
        if (!connection->ack_sender) {
                drbd_err(connection, "Failed to create workqueue ack_sender\n");
                return 0;